In this, we are going to see the do-while loop, the program is based on the do-while loop which basically detects negative numbers input by the user with the help of the C Programming language.Â
#include <stdio.h>
int main()
{
int num;
int sum = 0;
do
{
printf("Enter only non negative number ? Or else your negative number will be caught\n");
scanf("%d", &num);
} while (num >= 0);
printf("Hey you entered negative number : %d We have detected it", num);
return 0;
}
//..........Coded by ARADHANA MISHRA
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP