Write a program in C for showing working of
different logical operator in C.
Your program should guide users with proper
message/menu on the console
#include<stdio.h>
#include<conio.h>
void
main()
{
clrscr();
int
a,b,c,d,m,t;
float
x,y,j.k;
printf(“Enter
6 interger numbers: “);
scanf(“%d\n%d\n%d\n%d\n%d\n%d\n”,&a,&b,&c,&d,&m,&t);
printf(“Enter
4 decimal numbers: “);
scanf(“%f\n%f\n%f\n%f\n”,&x,&y,&j,&k);
if((a>b
&& c<d) || (x>y && j<k)||(m!=t))
printf(“its
demo for logical operator”);
else
printf(“logical
error is there in program”);
getch();
}
No comments:
Post a Comment