Computer Science, asked by raja249, 1 year ago

Give a program to print all the natural numbers from 1 to n by using while loop in c program

Answers

Answered by ManavSenguptaDPS
5
#include<stdio.h>
#include<stdlib.h>
int main()
{ int a=1;
int n=2;
while(a<n){
printf("The number is:%d",a);
n=n+1;
a=a+1;
}
return 0;
}

Hope I have Helped You!
Similar questions