Sunday, 3 May 2015

if else in c Programming Language

if  else in c Program

#include<stdio.h>
int main()
{
int a,b,c;
printf("Enter the Two number:");
scanf("%d%d",&a,&b);
c=a+b;
printf("the addition value:%d\n",c);
if(c==20)
{
printf("The two addition value Equal to C Value ");
}
else
{
printf(" The two addition value Not Equal to C value");
}
}

output

Check If :
Enter the two number :10
10

the addition value :20
The two addition value Equal to c value.


Check else:

Enter The Two number :10
11

the addition value:21
The Two addition values Not Equal to c value.

No comments:

Post a Comment