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   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Code Snippets  >>  Programming Code  >>  C Code
 
 


 

 
 C Code interview questions  C Code Interview Questions
 C++ Code interview questions  C++ Code Interview Questions
 VC++ Code interview questions  VC++ Code Interview Questions
 Java Code interview questions  Java Code Interview Questions
 Dot Net Code interview questions  Dot Net Code Interview Questions
 Visual Basic Code interview questions  Visual Basic Code Interview Questions
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions
Question
Print an integer using only putchar. Try doing it without
using extra storage.
 Question Submitted By :: =-pkg-=
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Print an integer using only putchar. Try doing it without using extra storage.
Answer
# 1
void putlong(unsigned long x)
{ if (x > 10) putlong(x / 10);
putchar(x % 10+'0');
}
main()
{
long int a;
printf("enter long integer:");
scanf("%d",&a);
putlong(a);
return 0;

}
 
Is This Answer Correct ?    5 Yes 0 No
Raghuram
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }  1
main() { int i=5; printf(“%d”,i=++i ==6); }  1
How to swap two variables, without using third variable ? HCL47
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }  1
int swap(int *a,int *b) { *a=*a+*b;*b=*a-*b;*a=*a-*b; } main() { int x=10,y=20; swap(&x,&y); printf("x= %d y = %d\n",x,y); }  1
What is the main difference between STRUCTURE and UNION?  6
main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } a. Runtime error. b. 0, 0 c. Compile error d. the first two values entered by the user HCL1
main() { char not; not=!2; printf("%d",not); }  1
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }  1
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above HCL1
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }  1
main() { int x=5; clrscr(); for(;x<= 0;x--) { printf("x=%d ", x--); } } a. 5, 3, 1 b. 5, 2, 1, c. 5, 3, 1, -1, 3 d. –3, -1, 1, 3, 5 HCL1
main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }  1
Program to find the largest sum of contiguous integers in the array. O(n)  7
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }  1
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }  1
#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }  1
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. Synergy2
main() { char *p; p="%d\n"; p++; p++; printf(p-2,300); }  1
#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }  1
 
For more C Code 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