PROBLEM:
Playing With Characters
https://www.hackerrank.com/challenges/playing-with-characters/problem
Once the string is inputted using "scanf" function then we don't need to use the "scanf" function again in C. This is the soul of the problem.
Once the string is inputted using "scanf" function then we don't need to use the "scanf" function again in C. This is the soul of the problem.
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main()
{
char c;
char s1[100];
char s[100];
scanf("%c\n",&c);
scanf("%s\n",&s1);
scanf("\n");
gets(s);
printf("%c\n",c);
printf("%s\n",s1);
printf("%s\n",s);
return 0;
}
No comments:
Post a Comment