C

Monday, 2 October 2017

Program Of Increment and Decrement Operator.

#include<stdio.h>
main()
{
int x,y,exp1,exp2;
clrscr();
x=10;
y=15;
exp1=x* ++y;
printf("Value of the first expression is: %d\n",exp1);
x=10;
y=15;
exp2=x* y++;
printf("Value of second expression is : %d\n",exp2);
}

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

Program To Find The Solution Of Mixed Mode Expression

#include<stdio.h>
main()
{
float exp1, exp2;
int A, I, J, K;
clrscr();
A=4.5;
I=1;
J=2;
K=3;
exp1= J*K+A;
exp2= K/J*(A+2.3*I);
printf("Value of first expression is : %f\n",exp1);
printf("Value of second expression is : %f\n",exp2);
}

Program To Find Value Of Float Expression.

#include<stdio.h>
main()
{
float exp1, exp2;
clrscr();
exp1=12.0/3.0+5.5*2.0-3.0;
exp2=(12.5+2.5)*2.0-(11.5-2.5)/3.0+13.5;
printf("Value of first expression is : %f\n",exp1);
printf("Value of second expression is :%f\n",exp2);

}

Program To Find The Value Of Integer Expressions

#include<stdio.h>
main()
{
int exp1, exp2, exp3;
clrscr();
exp1=4*5+5/2-9%2;
exp2=3*5/2+6*9%3+2*3-3;
exp3=3*(5+2*3)+25/(2*3+2);
printf("Value of first expression is : %d\n",exp1);
printf("Value of second expression is : %d\n",exp2);
printf("Value of third expression is : %d\n",exp3);

}

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