Pages

Wednesday, March 26, 2014

C Program to demonstrate Use of DoWhile Loop

/*use of do while loop*/
#include <stdio.h>
#include<stdlib.h>
int main()
{
    int mark;
    do
    {
        printf("\nEnter the number: ");
        scanf("%d",&mark);
        if(mark>100||mark<0)
            printf("Error:mark should be between 0 and 100: ");
    }while (mark>100||mark<0);
    system ("pause");
    return 0;
}

No comments:

Post a Comment