Take Free Quiz On C Programming ?

Join C Programming Community

Sunday, April 18, 2025

C If Condition Statement MCQ 1 : Non Zero number inside if

Information is
Bookmark and Share

C MCQ : if statement > Non Zero number inside if statement

#include<stdio.h>
void main()
{
int num=10;
if(num)
   printf("If Executed");
else
   printf("Else Executed");
}

Options : 
  1. If Executed
  2. Else Executed
  3. Compile Error : If Statement must have Condition.
  4. Run-Time Error



Why & How ?
Non Zero Number is TRUE
  1. Any number except Zero in If is considered as TRUE
  2. Value of Variable "num = 10" which is Considered as TRUE
  3. So IF block gets executed

0 comments:

Post a Comment

Your Feedback : This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email

Previous Next home
Related Posts with Thumbnails
Your Ad Here