ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
to find out the reverse digit of a given number
 Question Submitted By :: Nithya
I also faced this Question!!     Rank Answer Posted By  
 
  Re: to find out the reverse digit of a given number
Answer
# 1
#include<stdio.h>
#include<conio.h>
void main()
{
int n,a;
printf("enter the number to be reversed :");
scanf("%d",&n);
printf("the reversed number is :");
for(int i=0;n>0;i++)
{
a=n%10;
n=n/10;
printf("%d",a);
}
getch();
}
 
Is This Answer Correct ?    20 Yes 10 No
Vignesh1988i
 
  Re: to find out the reverse digit of a given number
Answer
# 2
#include<stdio.h>
#include<conio.h>
void main()
{
 int r,num,sum=0;
 clrscr();
 printf("Enter any Digit \n");
 scanf("%d", &num);
 while(num!=0)
 {
  r=num%10;
  sum=sum*10+r;
  num=num/10;
 }
 printf("Reverse Digit of a given number = %d",sum);
 getch();
}
 
Is This Answer Correct ?    18 Yes 7 No
Vishnu
 
 
 
  Re: to find out the reverse digit of a given number
Answer
# 3
#include<stdio.h>

int rev(int y);
int main()
{
  int x;
printf("\n please enter the number:\n");
scanf("%d",&x);
rev(x);
return 0;
}

int rev(int y)
{

int i;
do
{
   i=(y%10);
   printf("%d",i);
  y=(y/10);
}while(y>0);
}
 
Is This Answer Correct ?    6 Yes 2 No
Jet Lee
 
  Re: to find out the reverse digit of a given number
Answer
# 4
#include<stdio.h>
#include<conio.h>
void main()
{
  int no, t;
  clrscr();
  printf("\nenter the no.");
  scanf("%d",&no);
  while(no!=0)
  {
    t=no%10;
    no=no/10;
    printf("%d",t);
  } 
getch();
}
 
Is This Answer Correct ?    9 Yes 2 No
Vaibhav
 
  Re: to find out the reverse digit of a given number
Answer
# 5
#include<stdio.h>
#include<conio.h>
void main()
{
  int no, t;
  clrscr();
  printf("\nenter the no.");
  scanf("%d",&no);
  while(no!=0)
  {
    t=no%10;
    no=no/10;
    printf("%d",t);
  } 
getch();
}
 
Is This Answer Correct ?    2 Yes 0 No
Srinath, Hyd
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Give a fast way to multiply a number by 7 Microsoft8
how to display 2-D array elements in spiral  1
Write a C Programm.. we press 'a' , it shows the albhabetical number is 1, if we press 'g' it shows the answer 7.. any can help me  4
write a 'c' program to sum the number of integer values  5
Dear Sir, we are required the bubble sorting programs Regs Prem  1
what is the difference between getch() and getchar()?  5
Write code for finding depth of tree Adobe1
what is the use of fflush() function?  1
what is the differnce between AF_INET and PF_INET? Wipro2
What's wrong with "char *p = malloc(10);" ?  4
9.how do you write a function that takes a variable number of arguments? What is the prototype of printf () function? 10.How do you access command-line arguments? 11.what does ‘#include<stdio.h>’ mean? 12.what is the difference between #include<> and #include”…”? 13.what are # pragma staments? 14.what is the most appropriate way to write a multi-statement macro? L&T4
main() { char *p1="Name"; char *p2; p2=(char *)malloc(20); while(*p2++=*p1++); printf("%s\n",p2); } what is the output? Ramco4
Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV Accenture3
who is the founder of c HP9
what is the use of using linked list and array? Infosys9
Can you think of a way when a program crashed before reaching main? If yes how?  2
18)struct base {int a,b; base(); int virtual function1(); } struct derv1:base{ int b,c,d; derv1() int virtual function1(); } struct derv2 : base {int a,e; } base::base() { a=2;b=3; } derv1::derv1(){ b=5; c=10;d=11;} base::function1() {return(100); } derv1::function1() { return(200); } main() base ba; derv1 d1,d2; printf("%d %d",d1.a,d1.b) o/p is a)a=2;b=3; b)a=3; b=2; c)a=5; b=10; d)none 19) for the above program answer the following q's main() base da; derv1 d1; derv2 d2; printf("%d %d %d",da.function1(),d1.function1(),d2.function1 ()); o/p is a)100,200,200; b)200,100,200; c)200,200,100; d)none 20)struct { int x; int y; }abc; you can not access x by the following 1)abc-->x; 2)abc[0]-->x; abc.x; (abc)-->x; a)1,2,3 b)2&3 c)1&2 d)1,3,4  1
How to write a program for swapping two strings without using 3rd variable and without using string functions. iGate5
What is encapsulation?  1
what is calloc and malloc?  1
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com