9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855 SEARCHING FOR ACADEMIC PROJECT?
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855    ### C PROGRAM QUESTIONS : PART 5

Choose a syntax for C Ternary Operator from the list.

condition ? expression1 : expression2
condition : expression1 ? expression2
condition ? expression1 < expression2
condition < expression1 ? expression2

What is the output of the C statement.?
int main()
{
int a=0;
a = 5<2 ? 4 : 3;
printf("%d",a);

return 0;
}

4
3
5
2

What is the output of C Program.?
int main()
{
int a=0;
a = printf("4");
printf("%d",a);

return 0;
}

04
compiler error
40
41

What is the output of the C Program.?
int main()
{
int a=0;
a = 5>2 ? printf("4"): 3;
printf("%d",a);

return 0;
}

compiler error
14
41
0

What is the output of the C Program.?
int main()
{
int a=0;
a = (5>2) ? : 8;
printf("%d",a);

return 0;
}

0
1
8
compiler error

What is the output of C Program.?
int main()
{
int a=0, b;
a = (5>2) ? b=6: b=8;
printf("%d %d",a, b);

return 0;
}

6 6
0 6
0 8
compiler error

Choose a correct statement regarding C Comparison Operators.

(x == y) Is x really equal to y.

(x != y) Is x not equal to y.
(x < y) Is x less than y

(x > y) Is x greater than y
(x <= y) Is x less than or equal to y.

(x >= y) Is x greater than or equal to y
All the above

How many times cppbuzz.com is printed?
int main()
{
if(printf("cppbuzz.com"))
printf("cppbuzz.com");
return 0;
}

1
2
0
Compilation Error

#include  <stdio.h>
int main()
{
int a;
if(a = printf("cppbuzz-"))
{
printf("Good place to learn C");
}
else
{
}

return 0;
}

cppbuzz-Good place to learn C
Good place to learn C

#include  <stdio.h>
int main()
{
int a;
if(a == printf("cppbuzz-"))
{   printf("Bad place to learn C");

}
else
{
printf("Good place to learn C");
}

return 0;
}

cppbuzz-Good place to learn C
Good place to learn C

#include<stdio.h>
main()
{
int m=10;
if(m=30,20,0)
printf ("i love u %d",m);
else
printf ("i hate u %d",m);
}

i love u 30
i hate u 0
i love u 10
i hate u 30

Special data types that are defined by users is called

Conditional types
Compound types
Enumeration types
None of them