#string case

1 messages · Page 1 of 1 (latest)

polar mangoBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

#

@winter lark

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. In the future you can use !solved to close a post and mark a post as solved.

winter lark
#

#include<stdio.h>
int main(){
int a;
char arr[20];
float num;
printf("Enter a number and a float number and a sentence : ");
scanf("%d%f",&a,&num);
fgets(arr,sizeof(arr),stdin);
printf("%d\n%f\n",a,num);
printf("%s",arr);
return 0;

}

It didn't take input of sentence...and directly showing output after reading the float number.

normal mural
#

yeah thats what it is supposed to do

#

what are you trying to do?

winter lark
#

put a getchar right after your scanf and tell me if it works as expected

winter lark
polar mangoBOT
#

@winter lark Has your question been resolved? If so, type !solved :)

winter lark
#

!solved