Write a program to print a sentence many times using while loop in C programming.
Get link
Facebook
X
Pinterest
Email
Other Apps
C PROGRAM TO PRINT A SENTENCEMANY 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
Comments
Post a Comment