Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


# 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]();

}



# include<stdio.h> aaa() { printf("hi"); } bb..

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

Post New Answer

More C Code Interview Questions

Write a function to find the depth of a binary tree.

13 Answers   Adobe, Amazon, EFI, Imagination Technologies,


Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique.

5 Answers   IITR, Microsoft, Nike,


How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.

2 Answers  


main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”

5 Answers   HCL,


main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }

2 Answers   IBM,


void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }

2 Answers  


Give a oneline C expression to test whether a number is a power of 2?

25 Answers   EA Electronic Arts, Google, Motorola,


#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }

2 Answers  


char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }

1 Answers  


Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };

1 Answers  


how to check whether a linked list is circular.

11 Answers   Microsoft,


Program to Delete an element from a doubly linked list.

4 Answers   College School Exams Tests, Infosys,


Categories