func(a,b)
int a,b;
{
return( a= (a==b) );
}
main()
{
int process(),func();
printf("The value of process is %d !\n
",process(func,3,6));
}
process(pf,val1,val2)
int (*pf) ();
int val1,val2;
{
return((*pf) (val1,val2));
}
Answer / susie
Answer :
The value if process is 0 !
Explanation:
The function 'process' has 3 parameters - 1, a pointer to
another function 2 and 3, integers. When this function is
invoked from main, the following substitutions for formal
parameters take place: func for pf, 3 for val1 and 6 for
val2. This function returns the result of the operation
performed by the function 'func'. The function func has two
integer parameters. The formal parameters are substituted as
3 for a and 6 for b. since 3 is not equal to 6, a==b returns
0. therefore the function returns 0 which in turn is
returned by the function 'process'.
| Is This Answer Correct ? | 5 Yes | 2 No |
Code for 1>"ascii to string" 2>"string to ascii"
1 Answers Aricent, Global Logic,
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
which function is used to clear the buffer stream on gcc? for example: I wrote following code on gcc #include<stdio.h> int main(void) { char ch; int a,b; printf("\nenter two numbers:\t"); scanf("%d%d",&a,&b); printf("enter number is %d and %d",a,b); printf("\nentercharacter:\t"); scanf("%c",&ch); printf("enter character is %c",ch); return 0; } in above progarm ch could not be scan. why?plz tell me solution.
main() { printf("%d", out); } int out=100;
main() { int i; i = abc(); printf("%d",i); } abc() { _AX = 1000; }
Is the following code legal? struct a { int x; struct a b; }
find A^B using Recursive function
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](); }
main() { clrscr(); } clrscr();
main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }
1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.