Show the output produced by the following C prograu Mark you

Show the output produced by the following C prograu. Mark your final answer clearly. There are no syntax errors in the program. No explanation is needed. #include

Solution

#include <stdio.h>
#include <stdlib.h>

#define FIRST(x,y) x+y*y
#define SECOND(p,q) printf(\"%\"#p\"\ \",q)

int main()
{
int a = 1, b= 2;
printf(\"%d\ \",FIRST(a,b) );
printf(\"%d\ \",FIRST(a,b+1) );
SECOND(d,a);
return 0;
}

/*
output:

5
6
1

*/

defined function FIRST takes two input arguments and return a single argumnet using formula (x+y*y)
where x and y are input argumnets
first printf values is 5
and second printf value is 6

defined function SECOND takes two input argumnets and prints the value of second input argument and ignores the first argument, thus when function SECOND is passed d and a, there is no error even though d is not defined because the function does not use it. simply prints the seccond input argumnet.
Thus, the printed value for SECOND function call is 1 (value of a).

 Show the output produced by the following C prograu. Mark your final answer clearly. There are no syntax errors in the program. No explanation is needed. #incl

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site