Saturday, February 13, 2010

c,c++ qns

10. A structure pointer is defined of the type time . With 3 fields min,sec hours having pointers to intergers.
Write the way to initialize the 2nd element to 10.

11. In the above question an array of pointers is declared.
Write the statement to initialize the 3rd element of the 2 element to 10;

12.
int f()
void main()
{
f(1);
f(1,2);
f(1,2,3);
}
f(int i,int j,int k)
{
printf("%d %d %d",i,j,k);
}

What are the number of syntax errors in the above?

Ans: None.

13.
void main()
{
int i=7;
printf("%d",i++*i++);
}

Ans: 56

14.
#define one 0
#ifdef one
printf("one is defined ");
#ifndef one
printf("one is not defined ");

Ans: "one is defined"

No comments:

Post a Comment