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  >>  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
void main()
{
            int i=5;
            printf("%d",i++ + ++i);
}
 Question Submitted By :: Surenda Pal Singh Chouhan
I also faced this Question!!     Rank Answer Posted By  
 
  Re: void main() { int i=5; printf("%d",i++ + ++i); }
Answer
# 1
Output Cannot be predicted  exactly.

Explanation:
Side effects are involved in the evaluation of   i
 
Is This Answer Correct ?    0 Yes 1 No
Surenda Pal Singh Chouhan
 
  Re: void main() { int i=5; printf("%d",i++ + ++i); }
Answer
# 2
same as the pervious question....

11 ans
 
Is This Answer Correct ?    1 Yes 1 No
Guest
 
 
 
  Re: void main() { int i=5; printf("%d",i++ + ++i); }
Answer
# 3
I have compiled this program. The ans is 12
 
Is This Answer Correct ?    5 Yes 0 No
Basha
 
  Re: void main() { int i=5; printf("%d",i++ + ++i); }
Answer
# 4
ans :11
how?
 -> i++ => i=i+1 => i=6;
       
 -> ++i => i=i =>i=5(first assign the value);
           i=i+1;
   
    so i++ + ++i=6 + 5=11 i.e.ans
 
Is This Answer Correct ?    0 Yes 1 No
Sachin
 
  Re: void main() { int i=5; printf("%d",i++ + ++i); }
Answer
# 5
i++=5
++i=6

so i++ + ++i = 5+6=11
 
Is This Answer Correct ?    0 Yes 1 No
Jignesh Patel
 
  Re: void main() { int i=5; printf("%d",i++ + ++i); }
Answer
# 6
12
 
Is This Answer Correct ?    1 Yes 0 No
Dhakchina Moorthy.p
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is the differnce between AF_INET and PF_INET? Wipro1
why i join syntel? Syntel11
difference between i++* and *++i IBM2
program to get the remainder and quotant of given two numbers with out using % and / operators? IBM4
If we have an array of Interger values, find out a sub array which has a maximum value of the array and start and end positions of the array..The sub array must be contiguious. Take the start add to be 4000. For Ex if we have an array arr[] = {-1,-2,-5,9,4,3,-6,8,7,6,5,-3} here the sub array of max would be {8,7,6,5} coz the sum of max contiguous array is 8+7+6+5 = 26.The start and end position is 4014(8) and 4020(5). Microsoft3
f() { int a=2; f1(a++); } f1(int c) { printf("%d", c); } c=? Geometric-Software2
what is compiler  5
Result of the following program is main() { int i=0; for(i=0;i<20;i++) { switch(i) case 0:i+=5; case 1:i+=2; case 5:i+=5; default i+=4; break;} printf("%d,",i); } } a)0,5,9,13,17 b)5,9,13,17 c)12,17,22 d)16,21 e)syntax error IBM3
Write a programme to find even numbers without using any conditional statement? Infosys3
disadvantages of realloc ? HCL1
write a program to print sum of each row of a 2D array.  2
Give the output for the following program. #define STYLE1 char main() { typedef char STYLE2; STYLE1 x; STYLE2 y; clrscr(); x=255; y=255; printf("%d %d\n",x,y); } ADITI1
write a function to find whether a string is palindrome or not and how many palindrome this string contain?  1
Blade logic interview question. 1st round is a written tests with 15 multiple questions from c and c++. All are simple basic question. Like int main () { Int i=65; Return printf(“%c”, i); } 2nd and 3rd round is technical interview. The position for which I was interview was core UNIX and c. Yes it is for system programming. The company has product name blade server. For their server they are creating their own command for their purpose. Example cd command. We can implement it in a c program by using the chdir() function. So the question asks related to PID, fork, pipe, shared memory, signal. Write a program in c which will act as cp command. BladeLogic1
how to find out the inorder successor of a node in a tree?? TCS2
Can you think of a way when a program crashed before reaching main? If yes how?  2
Write a program that accepts a string where multiple spaces are given in between the words. Print the string ignoring the multiple spaces. Example: Input: “ We.....Are....Student “ Note: one .=1 Space Output: "We Are Student" IBM3
Unsigned char c; for ( c=0;c!=256;c++2) printf("%d",c); No. of times the loop is executed ? Mascot3
#include<stdio.h> main() { char *p1; char *p2; p1=(char *) malloc(25); p2=(char *) malloc(25); strcpy(p1,"Ramco"); strcpy(p2,"Systems"); strcat(p1,p2); printf("%s",p1); } Tell me the output? Ramco4
please give me some tips for the selection in TCS. TCS3
 
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