convert 12345 to 54321 withoutusing strig

Answer Posted / abhradeep chatterjee

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
printf("enter a number");
scanf("%d",&i);
for(int n=1;n<=5;n++)
{
j=i%10;
i=i/10;
printf("%d",j);
}
getch();
}

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between Structure and Unions?

629


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1203


pierrot's divisor program using c or c++ code

1718


How can a number be converted to a string?

586


Write a program to check prime number in c programming?

582






Do you know the difference between malloc() and calloc() function?

599


How can I read data from data files with particular formats?

591


what do u mean by Direct access files? then can u explain about Direct Access Files?

1633


What is the difference between char array and char pointer?

519


How to find a missed value, if you want to store 100 values in a 99 sized array?

803


How can I send mail from within a c program?

570


Can we access the array using a pointer in c language?

551


What is the difference between void main and main in c?

609


What is the purpose of main( ) in c language?

607


What are compound statements?

618