C program to read the values of x, y and z and print the results expressions in one line
C program to read the values of x, y and z and print the results expressions in one line
#include<conio.h>
void main()
{
int x, y, z;
float a, b, c;
clrscr();
printf("\nEnter the values of x,y and z : ");
scanf("%d %d %d", &x, &y, &z);
a = (x + y + z) / (x - y - z);
b = (x + y + z) / 3;
c = (x + y) * (x - y) * (y - z);
printf("\nValue of a = %f",a);
printf("\nValue of b = %f",b);
printf("\nValue of c = %f",c);
getch();
}
- (x+y+z) / (x-y-z)
- (x+y+z) / 3
- (x+y) * (x-y) * (y-z)
#include<conio.h>
void main()
{
int x, y, z;
float a, b, c;
clrscr();
printf("\nEnter the values of x,y and z : ");
scanf("%d %d %d", &x, &y, &z);
a = (x + y + z) / (x - y - z);
b = (x + y + z) / 3;
c = (x + y) * (x - y) * (y - z);
printf("\nValue of a = %f",a);
printf("\nValue of b = %f",b);
printf("\nValue of c = %f",c);
getch();
}
Comments
Post a Comment