Computer Science, asked by prasadpandav794, 11 hours ago

26) What is the correct about given program?
#include <stdio.h>
int x;
void main()
{
if (x);
else
printf("Else");
}
A) 'if block will be executed
B) 'else' block will be executed
C) Depends on the value of 'x' since it is undeclared
D) compilation error​

Answers

Answered by gaurangrj14
6

Answer:

One shall practice these interview questions to improve their C programming skills ... #include <stdio.h >; int main(); {; int x = 1;; short int i = 2;; float f = 3;; if ( sizeof((x == 2) ... else if (sizeof((x == 2) ? f : i) == sizeof( short int))

mark me in branlist

Answered by qwnerazzuri
0

Compilation error (Option D).

A compilation error will arise due to the "if" statement. Here in the if statement instead of giving a condition an undefined constant 'x' is written and due to this a compilation error will rise the program will stop.

To remove the error just give a condition in the if statement and give a value to the constant.

Similar questions