29: W.A.P. to read number until you entered positive numbers.

 

29: W.A.P. to read number until you entered positive numbers.

Program:

#include <stdio.h>

#include <conio.h>

 

void main()

{

    clrscr();

    int num;

    do

    {

        printf("Enter number = ");

        scanf("%d", &num);

    } while (num <= 0);

    getch();

}


Please follow me for more practicals....

 

Output:

Enter number = -5

Enter number = -4

Enter number = 3


Please follow me for more practicals....

 

Algorithm:

1.      START

2.      Declare num.

3.      Enter the value of num.

4.      If (num <= 0) then goto step 3.

5.      STOP


Please follow me for more practicals....

Flowchart:

Please follow me for more practicals....


Please follow me for more practicals....



Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.