# include<stdio.h>
aaa() {
printf("hi");
}
bbb(){
printf("hello");
}
ccc(){
printf("bye");
}
main()
{
int (*ptr[3])();
ptr[0]=aaa;
ptr[1]=bbb;
ptr[2]=ccc;
ptr[2]();
}
Answer / susie
Answer :
bye
Explanation:
ptr is array of pointers to functions of return type
int.ptr[0] is assigned to address of the function aaa.
Similarly ptr[1] and ptr[2] for bbb and ccc respectively.
ptr[2]() is in effect of writing ccc(), since ptr[2] points
to ccc.
| Is This Answer Correct ? | 2 Yes | 1 No |
Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];
main() { extern int i; i=20; printf("%d",sizeof(i)); }
There is a lucky draw held every day. if there is a winning number eg 1876,then all possible numbers like 1867,1687,1768 etc are the numbers that match irrespective of the position of the digit. Thus all these numbers qualify fr the lucky draw prize Assume there is no zero digit in any numbers. write a program to show all the possible winning numbers if a "winning number"is passed as an arguments to the function.
Derive expression for converting RGB color parameters to HSV values
Develop a routine to reflect an object about an arbitrarily selected plane
Find your day from your DOB?
15 Answers Accenture, Microsoft,
Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.
2 Answers Mentor Graphics, Microsoft,
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d..%d",*p,*q); }
Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector
void main() { int x,y=2,z; z=(z*=2)+(x=y=z); printf("%d",z); }
Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }
void main() { char ch; for(ch=0;ch<=127;ch++) printf(ā%c %d \nā, ch, ch); }