khoob study

Friday, November 4, 2022

If statement in C language

                                                   If statement in C language

# If  statement :- It is a simplest decesion making control statement . Where condition is evaluated . If condition is true then statement or set of  statements of  'if ' block will be executed .

Syntex of if statement :

if  (condition )

{

//  set of statement 

}

Algorithms for "if statement" 











EXAMPLE  :-

Program: For print even number.

#include<stdio.h>

#include<conio.h>

main()

{

int a;

clrscr();

printf("enter any number");

scanf("%d",&a);

if (a%2==0)

{

printf("%d is even " ,a);

}

getch();

}














Output :-





            THANK YOU FOR READING.........

No comments:

Post a Comment