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.
1 messages · Page 1 of 1 (latest)
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 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.
#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.
put a getchar right after your scanf and tell me if it works as expected
Yeah. It worked. Thanks a lot. So what exactly getchar does?
@winter lark Has your question been resolved? If so, type !solved :)
!solved