Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#includestdio.h #includestring.h int main(){ char text[30]; while(1){ printf(Enter text : ); scanf(%s,text); if(text[0]=='0'){ printf(no input found ); } printf( ); } return(0); } printf(Want to
#include"stdio.h"
#include"string.h"
int main(){
char text[30];
while(1){
printf("Enter text : ");
scanf("%s",text);
if(text[0]=='\0'){
printf("no input found ");
}
printf(" ");
}
return(0);
}
printf("Want to read file again? [y/n]: ");
choose=getchar();
printf(" ");
}
printf(" Good Bye! ");
return(0);
}
How can I get the output to display if there is no text in the input (like if the user just presses enter) so the printf("no input found "); line woks?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started