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       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
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
What will be the output of 
x++ + ++x?
 Question Submitted By :: Avani Negandhi
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What will be the output of x++ + ++x?
Answer
# 1
it will gives u a garbage value according to u r compiler
 
Is This Answer Correct ?    3 Yes 3 No
Dushmanta
 
  Re: What will be the output of x++ + ++x?
Answer
# 2
for this what is the input value of x.First of all we have 
to give the input value of x.
if x = 1 then answer would be
main();
int x=1,y.
y = x++ + ++x.
printf /n'%d',y.
here y = 3
 
Is This Answer Correct ?    6 Yes 3 No
Srinivas
 
 
 
  Re: What will be the output of x++ + ++x?
Answer
# 3
for this what is the input value of x.First of all we have 
to give the input value of x.
if x = 1 then answer would be
main();
int x=1,y.
y = x++ + ++x.
printf /n'%d',y.
here y = 3
 
Is This Answer Correct ?    1 Yes 3 No
Srinivas
 
  Re: What will be the output of x++ + ++x?
Answer
# 4
these type of expression  evaluation is dependent on
compiler

if u use turbo c and x =1;

 then answer would be
main();
int x=1,y.
y = x++ + ++x.
printf /n'%d',y.
here y = 4
 
Is This Answer Correct ?    9 Yes 2 No
Sadashiv
 
  Re: What will be the output of x++ + ++x?
Answer
# 5
if x=1 then output will be 4
 
Is This Answer Correct ?    5 Yes 2 No
Dhanashree
 
  Re: What will be the output of x++ + ++x?
Answer
# 6
x++ starts with x and ++x starts with x+1,hence if x=1 then
ans. is 3.
 
Is This Answer Correct ?    0 Yes 5 No
Mortal
 
  Re: What will be the output of x++ + ++x?
Answer
# 7
answer illl always be 4
value of x ill be 2+2
it willincrement only in 2nd case th ++x
 
Is This Answer Correct ?    2 Yes 3 No
Pardeep
 
  Re: What will be the output of x++ + ++x?
Answer
# 8
If x=4 then answer is 10
 
Is This Answer Correct ?    6 Yes 1 No
Lakshmi
 
  Re: What will be the output of x++ + ++x?
Answer
# 9
Answer is 2x+2. For Ex: if x is 2 result is 2(2)+2 = 6.
 
Is This Answer Correct ?    3 Yes 1 No
Santhi Perumal
 
  Re: What will be the output of x++ + ++x?
Answer
# 10
suppse if x=5,
then o/p will be 13
 
Is This Answer Correct ?    1 Yes 3 No
Vaibhav
 
  Re: What will be the output of x++ + ++x?
Answer
# 11
I have worked out this.in turbo c3
#include<stdio.h>
#include<conio.h>
void main()
{     clrscr();
	int x,y;
	x=4;
	printf("%d",x++ + ++x);
	getch();
}

output:
10
 
Is This Answer Correct ?    2 Yes 0 No
Manojkumar
 
  Re: What will be the output of x++ + ++x?
Answer
# 12
#include<stdio.h>
int main()
{
        int x=1,y;
        y=x++ + ++x;
        printf("y=%d\n",y);
        return 0;
}
o/p->
y=4
 
Is This Answer Correct ?    2 Yes 0 No
Debashree
 
  Re: What will be the output of x++ + ++x?
Answer
# 13
if x=3
y=x++ + ++x;
y will be 8
x will be 5

calculating y part
1) x++ is 3 and x will be 4
2)++x is 5 bcz x is incremented then assigned so x=5

so y finally gives 8.
 
Is This Answer Correct ?    0 Yes 0 No
Prem
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what does data structure mean?  7
C program to perform stack operation using singly linked list  3
Reverse the part of the number which is present from position i to j. Print the new number. eg: num=789876 i=2 j=5 778986  1
can we print any string in c language without using semicolon(;)(terminator) in whole program.  6
what are the languages used in c#? Infosys1
Toggle nth bit in a given integer - num Qualcomm2
what is the difference between #include<> and #include”…”?  1
can i know the source code for reversing a linked list with out using a temporary variable? Honeywell6
main() { int x=20,y=35; x = y++ + x++; y = ++y + ++x; printf("%d %d\n",x,y); } what is the output? Ramco4
could u able to tell about suresoft technical session  1
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.  2
how to generate sparse matrix in c  1
what is out put of the following code? #include class Base { Base() { cout<<"constructor base"; } ~Base() { cout<<"destructor base"; } } class Derived:public Base { Derived() { cout<<"constructor derived"; } ~Derived() { cout<<"destructor derived"; } } void main() { Base *var=new Derived(); delete var; } Honeywell2
swap two integer variables without using a third temporary variable?  2
what is the definition of storage classes? Wipro2
Write a program for deleting duplicate elements in an array Subex3
plz answer.. a program that takes a string e.g. "345" and returns integer 345  3
What is C language Terminator? TCS12
consider the following program sigment int n,sum=1; switch(n) { case 2:sum=sum+2; case 3:sum*=2; break; default:sum=0;} if n=2, what is the value of sum a.0 b.6 c.3 d.none TCS4
n=7623 { temp=n/10; result=temp*10+ result; n=n/10 } Wipro4
 
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