Input / Output

Q1:
What will be the output of the program ?
#include<stdio.h>

int main()
{
    int k=1;
    printf('%d == 1 is' '%s\n', k, k==1?'TRUE':'FALSE');
    return 0;
}

A k == 1 is TRUE

B 1 == 1 is TRUE

C 1 == 1 is FALSE

D K == 1 is FALSE

ANS:A - k == 1 is TRUE

Step 1: int k=1; The variable k is declared as an integer type and initialized to '1'. Step 2: printf('%d == 1 is' '%s\n', k, k==1?'TRUE':'FALSE'); becomes => k==1?'TRUE':'FALSE' => 1==1?'TRUE':'FALSE' => 'TRUE' Therefore the output of the program is 1 == 1 is TRUE



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.