- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Environmental Science
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to read the values of x, y and z and print the results expressions in one line using C Program
Problem Statement : Write a program to read the values of x, y and z and print the results of the following expressions in one line.
- (x+y+z) / (x-y-z)
- (x+y+z) / 3
- (x+y) * (x-y) * (y-z)
Program :
#include<stdio.h>
#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();
}
Output :
Enter the values of x,y and z : 1.1 2.5 5.5
Value of a = -1.000000
Value of b = 2010.000000
Value of c = 27939.000000
- Related Questions & Answers
- How to Calculate Area of Equilatral Triangle using C Language
- Write C Program to Find Factorial of Number Using Recursion
- What is SQL ?
- Write C Program to Find Largest Element in Array in C Programming
- How To Clean Up Unnecessary Code From WordPress Header Without Plugins
- Write a C program using pointers to read in an array of integers and print its elements in reverse order.
- How to find gretest in 3 number using C Programming
- How to convert temperature from degree centigrade to Fahrenheit using C
- Write C program to find Exponent Power Series
- How to check the type of triangle using C
- How to find sum of two numbers using C Language
- Top 50 Programming Interview Questions & Answers (2021)
- How to Calculate Area of Rectangle using C Program
- Recursive program to linearly search an element in a given array using C
- What are Python function attributes?
- How to Implement Stack Operations Using Array using C
Advertisements
ads