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                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   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 ?    8 Yes 0 No
Raghuram
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)! Wipro8
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }  1
main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }  1
#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }  1
# include <stdio.h> int one_d[]={1,2,3}; main() { int *ptr; ptr=one_d; ptr+=3; printf("%d",*ptr); }  1
main() { static int var = 5; printf("%d ",var--); if(var) main(); }  1
Write a procedure to implement highlight as a blinking operation  1
main() { struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }  1
main() { printf("%x",-1<<4); }  1
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it. Microsoft7
write a program to count the number the same (letter/character foreg: 's') in a given sentence.  2
Finding a number multiplication of 8 with out using arithmetic operator NetApp8
how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..! GATE3
void main() { static int i=5; if(--i){ main(); printf("%d ",i); } }  1
main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }  1
Given an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like. Microsoft16
main() { int i=5; printf("%d",++i++); }  1
String copy logic in one line. NetApp10
char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }  1
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above HCL1
 
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