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

How can a number be converted to a string?

611


The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference

679


why programs in c are running with out #include? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }

1323


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

664


Explain why can’t constant values be used to define an array’s initial size?

862






What is #ifdef ? What is its application?

651


What is console in c language?

616


Are bit fields portable?

681


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

611


What are local variables c?

556


What is the purpose of type declarations?

683


What is the size of empty structure in c?

599


How are structure passing and returning implemented?

595


Explain what are preprocessor directives?

634


Explain what is the purpose of "extern" keyword in a function declaration?

626