C Language MCQ - English
What will be the output of the program?
#include<stdio.h>
int
Home | Discussion Forum
int
What will be the output of the program?#include<stdio.h>
int check(int);
int main()
{
int i=45, c;
c = check(i);
printf("%d\n", c);
return 0;
}
int check(int ch)
{
if(ch >= 45)
return 100;
else
return 10;
}
Answer : A
View More Related Question
1) What will be the output of the program?#include<stdio.h>
int i;
int fun1(int);
int fun2(int);
int main()
{
extern int j;
int i=3;
fun1(i);
printf("%d,", i);
fun2(i);
printf("%d", i);
return 0;
}
int fun1(int j)
{
printf("%d,", ++j);
return 0;
}
int fun2(int i)
{
printf("%d,", ++i);
return 0;
}
int j=1;
2) What will be the output of the program?#include<stdio.h>
int sumdig(int);
int main()
{
int a, b;
a = sumdig(123);
b = sumdig(123);
printf("%d, %d\n", a, b);
return 0;
}
int sumdig(int n)
{
int s, d;
if(n!=0)
{
d = n%10;
n = n/10;
s = d+sumdig(n);
}
else
return 0;
return s;
}
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) Which of the following statements are correct about the program?#include<stdio.h>
int main()
{
printf("%p\n", main());
return 0;
}
View Answer
5) What will be the output of the program?#include<stdio.h>
int main()
{
int i=1;
if(!i)
printf("Study2Online,");
else
{
i=0;
printf("C-Program");
main();
}
return 0;
}
View Answer