Question
#include<stdio.h>
#include<stdarg.h>
int main()
{
void display(char *s, int num1, int num2, ...);
display("Hello", 4, 2, 12.5, 13.5, 14.5, 44.0);
return 0;
}
void display(char *s, int num1, int num2, ...)
{
double c;
char s;
va_list ptr;
va_start(ptr, s);
c = va_arg(ptr, double);
printf("%f", c);
}
a.
Error: invalid arguments in function display()
b.
Error: too many parameters
c.
Error: in va_start(ptr, s);
d.
No error
Posted under C Programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. Point out the error in the following program.
Similar Questions
Discover Related MCQs
Q. What are the different types of real data type in C ?
View solution
Q. What will you do to treat the constant 3.14 as a long double?
View solution
Q. Which of the following range is a valid long double (Turbo C in 16 bit DOS OS) ?
View solution
Q. We want to round off x, a float, to an int value, The correct way to do is
View solution
Q. The binary equivalent of 5.375 is
View solution
Q. A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored?
View solution
Q. What will you do to treat the constant 3.14 as a float?
View solution
Q. Which of the following statement obtains the remainder on dividing 5.5 by 1.3 ?
View solution
Q. Declare the following statement?
"An array of three pointers to chars".
View solution
Q. What do the following declaration signify?
int *ptr[30];
View solution
Q. Declare the following statement?
"A pointer to an array of three chars".
View solution
Q. What do the following declaration signify?
char *arr[10];
View solution
Q. What do the following declaration signify?
int (*pf)();
View solution
Q. Declare the following statement?
"A pointer to a function which receives an int pointer and returns float pointer".
View solution
Q. What do the following declaration signify?
void *cmp();
View solution
Q. Declare the following statement?
"A pointer to a function which receives nothing and returns nothing".
View solution
Q. What do the following declaration signify?
int *f();
View solution
Q. What do the following declaration signify?
void (*cmp)();
View solution
Q. What do the following declaration signify?
char **argv;
View solution
Q. What do the following declaration signify?
char *scr;
View solution
Suggested Topics
Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!