Advertisement
SAADQUAMER

Natural Number

Jun 8th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.25 KB | None | 0 0
  1. // C program to print all natural numbers from 1 to n.
  2. #include<stdio.h>
  3. int main(){
  4.  
  5. int n,i;
  6. printf("ENTER VALUE :");
  7. scanf("%d",&n);
  8. printf("All natural numbers from 1 to %d\n",n);
  9. for(i=1;i<n;i++){
  10.     printf("%d\n",i);
  11. }
  12. return 0;
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement