Skip to main content
To Get All Information of Sarkari Jobs | Results | Admit Card | And courses ,Internships then CLICK HERE

if-else Statement-:


if-else statement is a conditional statement which allows us to select and execute one statement or a group of statement out of two available statements or group of statements depending upon the truthfulness of a condition.
ads


Syntax-: 
if(condition)
statement-1;
else
statement-2;
or,
if(condition);
{ statement-1;
  statement-2;
  statement-3;
    -
    -
    -
  statement-n;
}
else
{statement-1;
   -
   -
   -
statement-n;
}
ads

Example-:
#include<stdio.h>
#include<conio.h>
main()
{int num=0;
printf("Enter the value of num");
scanf("%d",&num);
if(num%2==0)
printf("\n Even number");
else
printf("\n odd number);
getch();
}
output-:Enter the value of num 15
               odd number
Watch The Video Below


Comments

Post a Comment

Please do not enter any spam link in the comment box.


Download The Book "Let Us C" By Yashavant P.Kanetkar,Click The Below Button

-->Email Subscription

Enter Your Email Address:-

Delivered by FeedBurner

Copyright © 2020 TechProgramiz|All Right Reserved|Made By-: Sudarshan Pandey