int aaa() {printf(“Hi”);}
int bbb(){printf(“hello”);}
iny ccc(){printf(“bye”);}
main()
{
int ( * ptr[3]) ();
ptr[0] = aaa;
ptr[1] = bbb;
ptr[2] =ccc;
ptr[2]();
}
Answer / susie
Answer :
bye
Explanation:
int (* ptr[3])() says that ptr is an array of pointers to
functions that takes no arguments and returns the type int.
By the assignment ptr[0] = aaa; it means that the first
function pointer in the array is initialized with the
address of the function aaa. Similarly, the other two array
elements also get initialized with the addresses of the
functions bbb and ccc. Since ptr[2] contains the address of
the function ccc, the call to the function ptr[2]() is same
as calling ccc(). So it results in printing "bye".
| Is This Answer Correct ? | 3 Yes | 0 No |
main() { unsigned char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().
write a c-program to find gcd using recursive functions
main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }
hello sir,is there any function in C that can calculate number of digits in an int type variable,suppose:int a=123; 3 digits in a.what ll b answer?
Write a procedure to implement highlight as a blinking operation
Find your day from your DOB?
15 Answers Accenture, Microsoft,
programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h
void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }