C Language MCQ - English
Point out the error in the program
#include<stdio.h>
int f(in
Home | Discussion Forum
int f(in
Point out the error in the program#include<stdio.h>
int f(int a)
{
a > 20? return(10): return(20);
}
int main()
{
int f(int);
int b;
b = f(20);
printf("%d\n", b);
return 0;
}
Answer : C
View More Related Question
1) What will be the output of the program?#include<stdio.h>
int main()
{
void fun(char*);
char a[100];
a[0] = 'A';
a[1] = 'B';
a[2] = 'C';
a[3] = 'D';
fun(&a[0]);
return 0;
}
void fun(char *a)
{
a++;
printf("%c", *a);
a++;
printf("%c", *a);
}
2) How many times the program will print "Study 2 Online" ? #include<stdio.h>
int main()
{
printf("Study 2 Online");
main();
return 0;
}
3) Point out the error in the program#include<stdio.h>
int f(int a)
{
a > 20? return(10): return(20);
}
int main()
{
int f(int);
int b;
b = f(20);
printf("%d\n", b);
return 0;
}
View Answer
4) What will be the output of the program?#include<stdio.h>
int check (int, int);
int main()
{
int c;
c = check(10, 20);
printf("c=%d\n", c);
return 0;
}
int check(int i, int j)
{
int *p, *q;
p=&i;
q=&j;
i>=45 ? return(*p): return(*q);
}
5) What will be the output of the program in 16 bit platform (Turbo C under DOS)?#include<stdio.h>
int main()
{
int fun();
int i;
i = fun();
printf("%d\n", i);
return 0;
}
int fun()
{
_AX = 1990;
}