GeekInterview.com
Answered Questions

Short int and int

Asked By: chaitanyawithu | Asked On: Mar 26th, 2008

What is the difference between short int and int?

Answered by: jbode on: Feb 11th, 2012

The general idea is that short "always" represents a 16-bit integer, whereas int represents whatever the native word size is for that particular architecture (16- or 32-bit). "Always" is in scare quo...

Answered by: sumit on: Feb 5th, 2012

Sorry to say that actually in most of C compiler short int is also of 16 bit and they are equivalent to each other.

Recursive function

Asked By: iammilind | Asked On: Feb 22nd, 2008

1. Find output for following recursive function :int main(){int i=32242,j=find(i);}int find(int j){if(j){j = j%10 + find(j/10);printf(" %d ",j);}return j;} 2. What is the problem with following code : char* addnewlinetostring(char *s){char buffer[1024];strcpy(buffer,s);buffer[strlen(s)-1] = 'n';return...

Answered by: battlenexustnmt on: Mar 15th, 2011

The answer is 3  5 7 11 13

Answered by: windows_pal on: Aug 17th, 2008

 1.The answer is:24223

Output of a++ + ++a + a++

Asked By: crackboy | Asked On: Feb 9th, 2008

What is the answer of a++ + ++a + a++ int a=5;c = a++ + ++a + a++;//compiler produces the answer 28!!!//how

Answered by: peter on: Mar 25th, 2012

Which operation in the following expression will be performed first?

c = a++ / b + 5;

Answered by: Asarudeen on: Feb 9th, 2012

c = a++ + ++a + ++a Compiler starts from leftmost operand

Code
  1. 1+5 = 6
  2.  
  3. a = 6
  4.  
  5. 1+6 =7
  6.  
  7. a = 6+7
  8.  
  9. a =13
  10.  
  11. 1+13 =14
  12.  
  13. Now
  14.  
  15. c = 6+ ++7 ++13
  16.  
  17. c = 28

Interview Question

 Ask Interview Question?

 

Career Counselling

 Have Career Question?

 Ask Chandra

 Ask Only Career questions.

Follow us: