Solution of c programming. PLAYING WITH CHARACTER with hacker rank

 /*Task

You have to print the character, , in the first line. Then print  in next line. In the last line print the sentence, 

Sample Input 0

C
Language
Welcome To C!!

Sample Output 0

C
Language 

Welcome To C!!*/


#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main() 
{
char ch;
char s[100];
char sen[100];
    scanf("%c", &ch);
    scanf("%s", &s);
    scanf("\n");
    scanf("%[^\n]%*s", &sen);
    
    
    printf("%c \n",ch);
    printf("%s \n", s);
    printf("%s ",sen);
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */    
    return 0;
}




Comments

Popular posts from this blog

Allocate Book Problem Solution || Code Studio

Peak Index in a Mountain Array || Binary Search practice example || Leet Code poblem #852

First and Last position of an element in sorted array | Binary Search Practice Example | Code Studio Interview Question