Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

simple c program for 12345 convert 54321 with out using string

Answer Posted / ruchi

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int n,r,s=0,i=0,m,r1,m1,m2,p,d,s1;
clrscr();
printf("enter the number ");
scanf("%d",&n);
m=n;
while(n>0)
{
r=n%10;
n=n/10;
i=i+1;
}
m1=m%10;
d=m/10;
p=m1*pow(10,i=i-1);
while(d>=10)
{
m2=d%10;
d=d/10;
s=(s+m2*pow(10,i=i-1));
}
s1=(s+p+d*pow(10,i=i-1));
printf("%d",s1);
getch();
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

All technical questions

1992


What are bitwise shift operators in c programming?

1085


What is memcpy() function?

1126


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1795


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

2079


Explain bitwise shift operators?

1253


Why is c fast?

1070


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1642


What are linked lists in c?

1132


Explain 'bit masking'?

1093


Is c is a low level language?

1145


What are conditional operators in C?

1103


Is c procedural or object oriented?

1024


How will you declare an array of three function pointers where each function receives two ints and returns a float?

1376


What is the function of multilevel pointer in c?

1087