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

what are enumerations in C

1171


Was 2000 a leap year?

1062


Is null equal to 0 in sql?

1161


When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?

1284


How to get string length of given string in c?

1073


Is a pointer a kind of array?

1196


What is a program flowchart and how does it help in writing a program?

1154


What does void main () mean?

1255


Define macros.

1286


Explain how do you search data in a data file using random access method?

1140


int i=10; printf("%d %d %d", i, i=20, i);

1631


what are the facialities provided by you after the selection of the student.

2272


What are the applications of c language?

1085


Differentiate between null and void pointers.

1183


An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above

1227