Saturday, March 14, 2009

Subex Azure Paper


Paper Type : Technical - C & C++
Posted By : admin


Some Technical Questions

1.

void main()
{
enum bool{true,false};
if(true==(2==3)
printf(“..
else
printf(“..
}
2.

void main()
{
printf(“%d”,(float)3/2);
}
3.

void main()
{
int (*func)(const *char)=strlen;
printf(“%d”, func(“Hello”);
}
4.

void main() {
char *s=”Hello World”;
printf(“%c”,s);
}
5.

File fp,fs;
fp=fopen(“tc.dat”,”w”);
fs=fopen(“tc.dat”,”w”);
putch(‘A’,fp);
putch(‘B’,fs); What will happen?
6.

What is the equivalent of a[i] Ans: *(a+i)
7.

int (*func)(int,int) is a pointer to a function with 2 integers as parameters and returning an integer value.
8.

int *(*func)(int *,int *) is a pointer to a function with 2 integer pointers as parameters and returning a pointer to

an integer Which of a and b is true?
Ans: Both are true.
9.

switch(float value) this is compiler error.
10.

int a[5]={1,2,3,4,5};
int *p=a+1;
int *q=a+5;

int dif=q-p;
value of dif is 4 ( q-p is evalueated as q-p/sizeof int)
11.

Switch(NULL)
ans: case 0: will be executed.
12.

#define exp 5
printf("%d",exp++);
ans: compilation error lvalue required
13.

strcat(str,str);
ans: compilation error
14.

Pointers can be subtracted from each other, can be added, constant cab be added or subtrated from pointer, but multipilcation with constant to pointer is not possible.
15.

int(*ptr)[10] pointer to array of 10 integers.

Related Articles :


Stumble
Delicious
Technorati
Twitter
Facebook

0 comments:

Post a Comment

Career Launchers!!!

Note:

This blog can be viewed using all the browsers but can be best viewed in Mozilla Browser.
 

Career Launchers!!! Copyright © 2010 LKart Theme is Designed by Lasantha