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

Answers were Sorted based on User's Feedback



simple c program for 12345 convert 54321 with out using string..

Answer / vignesh1988i

hi good morning folks... happy sunday.......

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


thank u

Is This Answer Correct ?    31 Yes 11 No

simple c program for 12345 convert 54321 with out using string..

Answer / sreenivas

#include<stdio.h>
main()
{
long n=12345,r=0;
while(n)
{
r=r*10+n%10;
n=n/10;
}
printf("%ld",r);
}

Is This Answer Correct ?    13 Yes 2 No

simple c program for 12345 convert 54321 with out using string..

Answer / 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 2 No

simple c program for 12345 convert 54321 with out using string..

Answer / sharan

#include<stdio.h>
//#include<conio.h>
void main()
{
int n,m;
printf("enter the number :");
scanf("%d",&n);
while (n)
{
m=n%10;
n=n/10;
printf("%d",m);
}
printf("\n");
}

Is This Answer Correct ?    7 Yes 4 No

simple c program for 12345 convert 54321 with out using string..

Answer / 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

simple c program for 12345 convert 54321 with out using string..

Answer / mohit

#include<stdio.h>
#include<conio.h>
main()
{
long int num,x=0;
int b;
while(n>0)
{
b=num%10;
num=num/10;
x=x*10+b;
}
printf("new number=%ld",x);
getch();
}

Is This Answer Correct ?    3 Yes 0 No

simple c program for 12345 convert 54321 with out using string..

Answer / rajan sonvane

#include<stdio.h>
#include<conio.h>
main()
{
int *p,a[5]={1,2,3,4,5},b[5],i=0;
p=a;
while(i<5)
{

b[i]=*(p+4-i);

i++;
}
for(i=0; i<5; i++)
{
printf("%d",b[i]);
}
getch();
}

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Interview Questions

the maximum width of a c variable name can be a) 6 characters b) 8 characters c) 10 characters d) 20 characters

2 Answers  


program in c to print 1 to 100 without using loop

9 Answers   Wipro,


Where we use clrscr in c?

0 Answers  


What is switch in c?

0 Answers  


Write a program to add the following ¼+2/4+3/4+5/3+6/3+... (Like up to any 12 no.s)

1 Answers   HTC,


What is type qualifiers?

0 Answers  


what is inline function?

2 Answers  


What are nested functions in c?

0 Answers  


write a programme to enter some number and find which number is maximum and which number is minimum from enterd numbers.

3 Answers  


Define and explain about ! Operator?

0 Answers  


What are header files in c programming?

0 Answers  


Can we use any name in place of argv and argc as command line arguments?

0 Answers  


Categories