Showing posts with label ASCII. Show all posts
Showing posts with label ASCII. Show all posts

Saturday, 7 January 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 2

Predict the output or error(s) for the following:


1)

#include<stdio.h>

main()

{

  char s[]={'a','b','c','\n','c','\0'};


  char *p,*str,*str1;


  p=&s[3];


  str=p;


  str1=s;


  printf("%d",++*p + ++*str1-32);


}

Answer:

M


Explanation:

Sunday, 6 November 2011

Predict the output or error(s) for the following:

 #include<stdio.h>

main()

{

char s[]={'a','b','c','\n','c','\0'};


char *p,*str,*str1;


p=&s[3];


str=p;


str1=s;


printf("%d",++*p + ++*str1-32);


}

Answer:

77


Explanation: