Professional Documents
Culture Documents
Class Lec 03
Class Lec 03
Class Lec 03
Write a C code to take two inputs from the user and give output the sum
of them.
Example
• Can you solve that problem without using that extra integer c ?
N.B
• You are expected to let the user know that he has to input 5 integers.
• Remember that the average may not be an integer. Are you clear
about it ?
Solve
Additional Information
• Most of the times using more variables than necessary is inefficient.
• Writing complex equation is perfectly right in C. Some example are
given below:
• z= x+y+p/q;
• a= (b % c) + b + a;
• a= a * a * a;
• When you are writing lines like x=5*x then the value of x is changed
now and it becomes 5 times the previous value.
• Similarly writing x=x-3 reduces the value by 3.
Example