Include Stdio H Int Main Int Count Printf Enter Number 0 Or 1 For The Count Sca
#include <stdio.h>
int main( )
{
int count;
printf(“Enter number 0 or 1 for the count: “);
scanf(“%d”, &count);
while ( count >= 0 )
{
switch(count)
{
case 0:
printf(“n%d is the number you have enterednn”, count);
break;
case 1:
printf(“n%d is the number you have enterednn”, count);
break;
default:
printf(“nnIncorrect Input – You didn’t enter 0 or 1.nn”);
break;
}
printf(“Enter number 0 or 1 for the count: “);
scanf(“%d”, &count);
}
return 0;
}
Draw a structured flowchart and write pseudo code that describes the above program. After each iteration, the decision-making structure will indicate whether you entered 0, 1, or any other number. The iteration continues until the input value is less than 0.
Leave a Reply
Want to join the discussion?Feel free to contribute!