GUVI
Back

this program is unable to submit but it is the correct one which gives the output

Created 2 years ago
34 Views
1 Comments
TharuneshI7Q4Ka
@TharuneshI7Q4Ka
TharuneshI7Q4Ka
@TharuneshI7Q4KaProfile is locked. Login

#include<stdio.h>

int main(void)

{

int o[10],e[10],r,i=0,j=0,ol,el;

long int x;

scanf("%ld",&x);

while(x>0)

{

r=x%10;

if(r%2==0)

{

e[i]=r;

i++;

}

else

{

o[j]=r;

j++;

}

x=x/10;

}

for(el=i-1;el>=0;el--)

{

if(el!=0)

printf("%d",e[el]);

else

printf("%d\n",e[el]);

}

for(ol=j-1;ol>=0;ol--)

{

if(ol!=0)

printf("%d",o[ol]);

else

printf("%d",o[ol]);

}

return 0;

}

Comments
Please login to comment.
 
Powered by habitate.io Habitate