SET OF PROGRAMS

This blog provided "C" programs for beginners. Providing c programs for students.enjoy this blog.this blog include many c programs for engineering students, IT engineering students and programmers this blog is very useful.this blog post daily 1-5 programs for you.this programs use full for devlop games devlops application and much more. This blog programs useful for projects because all programs post with explanations.

Search Bar

Ads Here

Wednesday, 31 July 2019

Write a C program accept a number from user and check whether it is more than 100 . if the given number greater than 100print one msg and if it is less than 100 then print another msg.

Example Of if else statement in C programming.

flowchart:-



Program

#include<stdio.h>
#include<conio.h>        //include header files

void main()
{
int n;
printf("\n enter a number:-");
scanf("%d",&n);                                             //accept number from user

if(n>100)
{
printf("\n number is greater than 100"); //if the condition is true this msg will display
}                                                                         

else
{

printf(" number is less than 100"); //if the condition is false then this msg will display 
}

}       


Output:-
                    enter a number : 50
                    number is less than 100


Explanation:-

- Here program accepts a number from user.
- If the number is greater than 100, it will print the massage--"Number is greater than 100".
-If number is less than 100, it will print the massage "number is less than 100"

No comments:

Post a Comment