Welcome to PracticalKida, in this blog post, we solve 313304 Object Oriented Programming Using C++ OOP Manual Practical No.1 with the title Write programs to evaluate any expression using Input/Output functions.
This practical is useful for students when evaluating expressions using different types of operators and input/output functions. Students will be able to assess any expressions in the C++ program.
313304 Manual Practical No.1 Theoretical Background
Operators in C++:
An operator is a symbol that operates on a value to perform specific mathematical or logical
computations. They form the foundation of any programming language. In C++, we have
built-in operators to provide the required functionality. An operator operates the operands. For example,
int c = a + b;
Here, ‘+’ is the addition operator. ‘a’ and ‘b’ are the operands that are being ‘added’.
Different types of operators are:
- Arithmetic Operators
- Relational Operators
- Logical Operators
- Bitwise Operators
- Assignment Operators
- Ternary or Conditional Operators
Exercise:
- Write a C++ code to evaluate the following expression using the input-output function:
y= 5*x-5 where the value of x is taken from the user. Find the value of y.
Answer:
- Write a program to print the “hi” msg if the entered value is more than 10 otherwise, print the “bye” msg on the output screen. (Use of Relational operator).
Answer:
- Write a program to print the largest number among two numbers using the Conditional operator.
Answer:
Write “C++” Code for the above exercise on the blank pages attached at the end of the practical.
Practical Related Questions
- Write a C++ program to evaluate the following expressions: X=(-b-(b2 -4ac))/2a.
Answer:
- Complete the following table:
Conclusion
We completed 313304 Object Oriented Programming Using C++ OOP Manual Practical No.1 in which we wrote many C++ programs and got desired output.