Advertisement
Hafizur

print all natural numbers from 1 to n.

Jun 8th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.21 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int i,n;
  5.     printf("Enter Any Natural Number:");
  6.     scanf("%d",&n);
  7.     printf("1 to %d\n",n);
  8.     for(i=1;i<=n;i++){
  9.         printf("%d\n",i);
  10.     }
  11.     return 0;
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement