Advertisement
samrina_sarkar_7

First natural number

Jul 4th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int n,num;
  5.     printf("Enter the number: ");
  6.     scanf("%d",&n);
  7.     while(n!=0)
  8.     {
  9.         num=n%10;
  10.  
  11.         n=n/10;
  12.     }
  13.     printf("First natural number= %d\n",num);
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement