C

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);
}

No comments:

Post a Comment

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) {         ...