Computer Science, asked by MugdhaH, 1 year ago

write a program to print N natural numbers using while loop​

Answers

Answered by rakshana004
2

#include <stdio.h>

int main()

{

int i, end;

/*

* Input a number from user

*/

printf("Print all natural numbers from 1 to : ");

scanf("%d", &end);

/*

* Print natural numbers from 1 to end

*/

i=1;

while(i<=end)

{

printf("%d\n", i);

i++;

}

return 0;

}

Hope it helps


MugdhaH: thanks so much
rakshana004: Mark as brainliest
rakshana004: welcome
Similar questions