Question: #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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!