Write a program to print a sentence many times using while loop in C programming.

      C PROGRAM TO PRINT A SENTENCE                                    MANY TIMES

Syntax:

while(condition)
{
    body;
   i++;
}

Program:-

#include<stdio.h>
int main()
{
int i=1,n;
        printf("Enter the number of times you have to print:);
        scanf("%d",&n);
while(i<=n)
{
printf("I am good\n");
i++;
}
return 0;

}

OUTPUT:- Enter the number of times you have to print:5

                    I am good

                    I am good

                    I am good

                    I am good

                    I am good




Thank you all -----

Follow my blog for more programming knowledge...

------------------x----------------------x-------------------------x------------------

Comments