This blog consists of C and C++ programs. C and C++ programming is the basics to learn any programming language. Most of the programs are provided with their respective outputs. This blog also contains Data Structures programs using Object-Oriented Programming (C++). Some of the best books for learning C and C++ programming are also mentioned.

Friday 1 November 2013

C program for Logical Operators

C program for Logical Operators:

#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c,d,e,f;
clrscr();
printf("Enter the value of a:");
scanf("%d",&a);
printf("Enter the value of b:");
scanf("%d",&b);
printf("Enter the value of c:");
scanf("%d",&c);
d=(a>b)&&(a>c);
e=(a>b)||(a>c);
f=!(a>b);
printf("\nAND=%d",d);
printf("\nOR=%d",e);
printf("\nNOT=%d",f);
getch();
}

No comments:

Post a Comment