kaldin

  • Login

C Programming


1) Point out the error in the following program.

#include<stdio.h>
#include<stdarg.h>
void varfun(int n, ...);

int main()
{
    varfun(3, 7, -11.2, 0.66);
    return 0;
}
void varfun(int n, ...)
{
    float *ptr;
    int num;
    va_start(ptr, n);
    num = va_arg(ptr, int);
    printf("%d", num);
}
  • A)

  • B)

  • C)

  • D)

Next
Show Answer:
Show Answer


More Question
What will be the output of the program #includestdio.h#define SQR(x)(xx)int main() int a, b=3; a = SQR(b+2); printf(d\n, a); return 0;
Point out the error, if any in the program. #includestdio.hint main() int P = 10; switch(P) case 10: printf(Case 1); case 20: printf(Case 2); break; case P: printf(Case 2); break; return 0;
Will the program compile in Turbo C #includestdio.hint main() int a=10, j; void k; j=k=&a; j++; k++; printf(u u\n, j, k); return 0;
A preprocessor directive is a message from programmer to the preprocessor.
Which of the following errors would be reported by the compiler on compiling the program given below #includestdio.hint main() int a = 5; switch(a) case 1: printf(First); case 2: printf(Second); case 3 + 2: printf(Third); case 5: printf(Final); break; return 0;