Const

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

int main()
{
    const c = -11;
    const int d = 34;
    printf('%d, %d\n', c, d);
    return 0;
}

A Error

B -11, 34

C 11, 34

D None of these

ANS:A - Error

Step 1: const c = -11; The constant variable 'c' is declared and initialized to value '-11'. Step 2: const int d = 34; The constant variable 'd' is declared as an integer and initialized to value '34'. Step 3: printf('%d, %d\n', c, d); The value of the variable 'c' and 'd' are printed. Hence the output of the program is -11, 34



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.