Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions