Monday, 2 October 2017
Program To Find The Values Of Logical Operators Expressions.
#include<stdio.h>
main()
{
int x=60, y=200, b=2, c=160;
int exp1, exp2, exp3, exp4, exp5, exp6;
clrscr();
exp1= x<y;
exp2= x+y<y;
exp3= x*b==120;
exp4= (x==60)&&(y>b);
exp5= (y!=60)||(c>x);
exp6= !(x>60);
printf("Value of first expression is : %d\n",exp1);
printf("Value of second expression is : %d\n",exp2);
printf("Valye of third expression is : %d\n",exp3);
printf("Value of forth expression is : %d\n",exp4);
printf("Value of fith expression is : %d\n",exp5);
printf("Value of sixth expression is : %d\n",exp6);
}
main()
{
int x=60, y=200, b=2, c=160;
int exp1, exp2, exp3, exp4, exp5, exp6;
clrscr();
exp1= x<y;
exp2= x+y<y;
exp3= x*b==120;
exp4= (x==60)&&(y>b);
exp5= (y!=60)||(c>x);
exp6= !(x>60);
printf("Value of first expression is : %d\n",exp1);
printf("Value of second expression is : %d\n",exp2);
printf("Valye of third expression is : %d\n",exp3);
printf("Value of forth expression is : %d\n",exp4);
printf("Value of fith expression is : %d\n",exp5);
printf("Value of sixth expression is : %d\n",exp6);
}
Subscribe to:
Posts (Atom)
Write a program to draw a circle using mid-point circle drawing algorithm.
#include<iostream.h> #include<graphics.h> #include<conio.h> void drawcircle(int x0, int y0, int r) { ...
-
#include<iostream.h> #include<conio.h> #include<graphics.h> void drawCircle(int x, int y, int xc, int yc); void...
-
#include<stdio.h> #include<conio.h> main() { int a=8, b=12; clrscr(); printf("Before swap of two numbers a=%d b=%...
-
#include<stdio.h> main() { int num,i=1; printf("Enter the number whose multiple you want"); scanf("%d",...