Advertisement
rony-Rony_05

4{b}

Aug 26th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int n,r,sum=0,temp;
  5.     scanf("%d",&n);
  6.     temp=n;
  7.     while(temp!=0)
  8.     {
  9.         r=temp%10;
  10.         if(r%2!=0){
  11.         sum=sum*10+r;}
  12.         temp=temp/10;
  13.     }
  14.     int r1,s=0,temp1;
  15.     temp1=sum;
  16.     while(temp1!=0)
  17.     {
  18.         r1=temp1%10;
  19.         s=s*10+r1;
  20.         temp1=temp1/10;
  21.     }
  22.     printf("%d",s);
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement