coder18s,blogspot.com

Powered by Blogger.

2. Playing With Characters Hackerrank Solution

 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 

C
Language
Welcome To C!!

Sample Output 

C
Language
Welcome To C!!
                        Program Code
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main() 
{
    char ch , str[50] ,sen[100];
    scanf("%c",&ch);
    printf("%c\n",ch);
    scanf("%s",&str);
    scanf("\n");
    printf("%s\n",str);
    gets(sen);
    printf("%s\n",sen);   
    return 0;
}