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
main()

{

  int x=5;

  clrscr();

  for(;x==0;x--) {

    printf("x=%d\n”", x--);

  }

}

a. 4, 3, 2, 1, 0

b. 1, 2, 3, 4, 5

c. 0, 1, 2, 3, 4

d. none of the above
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", x--); } } a. 4, 3, 2, 1, 0 b. 1, 2, 3, 4, 5 c. 0, 1, 2, 3, 4 d. none of the above
Answer
# 1
d) prints nothing, as condition x==0 is False
 
Is This Answer Correct ?    0 Yes 0 No
Guest
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
You are given any character string. Find the number of sets of vowels that come in the order of aeiou in the given string. For eg., let the given string be DIPLOMATIC. The answer returned must be "The number of sets is 2" and "The sets are "IO and AI". Vowels that form a singleton set must be neglected. Try to post the program executable in gcc or g++ or in java.  3
union u { struct st { int i : 4; int j : 4; int k : 4; int l; }st; int i; }u; main() { u.i = 100; printf("%d, %d, %d",u.i, u.st.i, u.st.l); } a. 4, 4, 0 b. 0, 0, 0 c. 100, 4, 0 d. 40, 4, 0 HCL1
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal.  5
Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }  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() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }  1
main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; } a. Runtime error. b. Runtime error. Access violation. c. Compile error. Illegal syntax d. None of the above HCL1
main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }  1
main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }  1
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above HCL1
main() { char *p; p="%d\n"; p++; p++; printf(p-2,300); }  1
main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }  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
void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }  1
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }  1
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!  7
What is the hidden bug with the following statement? assert(val++ != 0);  1
const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above HCL1
void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }  1
main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }  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