Wednesday, April 15, 2020

print a character and a string and sentence

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


int main()
{
char a,a1[50],a2[100];
scanf("%c%*c",&a);
scanf("%s%*c",&a1);
scanf("%[^\n]",&a2);
printf("%c\n%s\n%s",a,a1,a2);
return 0;
}

output:
h
hello
how are you

h
hello
how are you

No comments:

Post a Comment

python class topic video