Call
whatsapp
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855
Cisco Training in Trivandrum, Trinity Technologies

No.1 Training Institute in Kerala

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
SHOW ANSWER

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
SHOW ANSWER

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
SHOW ANSWER

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
SHOW ANSWER

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
SHOW ANSWER

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
SHOW ANSWER

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
SHOW ANSWER

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

1
2
 0
Compilation Error
SHOW ANSWER


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

cppbuzz-Good place to learn C
cppbuzz-Bad place to learn C
 Good place to learn C
 Bad place to learn C
SHOW ANSWER

#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-Bad place to learn C
cppbuzz-Good place to learn C
 Bad place to learn C
 Good place to learn C
SHOW ANSWER


#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
SHOW ANSWER

Special data types that are defined by users is called

Conditional types
Compound types
Enumeration types
None of them
SHOW ANSWER

In C++ words that is already defined and is reserved for a single special purpose, is called as

Keywords
Statements
Functions
Queries
SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in