Friday, March 28, 2014

Taking Decision using single if statement. If variable entered is 7 print entered number is 7 otherwise print number entered is not equal to 7

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
void line()
{
int i;
    printf("\n");
for(i=1;i<=35;i++)
    printf("=");
}
void header()
{
printf("\n");
printf(" Built and Designed by Arslan Malik");
printf("\n");
}
int main()
{
line();
header();
line();

int a,thisVariable,q76354,number;
printf("\nEnter a Number : ");
scanf("%d",&a);
if (a!=7)
    printf("\nThe variable is not equal to 7.");
else printf("You have entered variable 7.\n");
return 0;
}

No comments:

Post a Comment