Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Arithmetic Operators

Question#1: Write a C++ program to add two numbers

Question#2: Write a C++ program to subtract two numbers

Question#3: Write a C++ program to multiply two numbers

Page | 1
Question#4: Write a C++ program to divide two numbers

Question#5: Write a C++ program to fine even or odd number.

Page | 2
Question#6: Write a C++ program to take one number and increment it 2 times

Question#7: Write a C++ program to input a number and decrement it 2 times

Page | 3
Relational Operators
Question#1: Write a C++ program to check whether the marks of two students are
equal or not?

Question#2: Write a C++ program to check the two numbers are equal or not?

Page | 4
Question#3: Write a C++ program to check which number is greater than other?

Question#4: Write a C++ program to check which number is smaller than other

Page | 5
Question#5: Write a C++ program to take marks of two students. Check if the
marks of both students are greater or equal to 50 show that they are passed else
they are failed.

Question#6: Write a C++ program to take a number from user. Check if the
number is smaller or equal to 50. If yes print failed else print you are passed.

Page | 6
Logical Operators
Question#1: Write a C++ program to take marks of a student in math, physics and
chemistry. Check whether marks of each subject is greater than 50 or not.

Question#2: Write a C++ program to take two numbers from user. Check if any of
the numbers is greater than 40

Page | 7
Question#3: Write a C++ program to take two numbers from user. Check if
numbers are equal

Assignment Operators
Question#1: Write a C++ program to take a number from user and assigned it to
another variable.

Page | 8
Question#2: Write a C++ program to take a number from user and increment 10 in
the number

Question#3: Write a C++ program to take a positive number from user and subtract
2 in that number

Question#4: Write a C++ program to take 2 positive number from user and
multiply them and assigned the answer to first variable and display.

Page | 9
Question#5: Write a C++ program to take 2 positive number from user and divide
them and assigned the answer to first variable and display.

Question#6: Write a C++ program to take two numbers and take modulus display
result

Page | 10
Misc Operators
Question#1: Write a C++ program to find size of data types

Question#2: Write a C++ program to assign the value of 30 if user enters value is
less than 10 and 40 if it is not.

Question#3: If a=10, 20, 30 and b= (10, 20, 30) then what will be the output? Use
comma operator

Page | 11
Question#4: Write a c++ program to convert data type float to int

Question#5: Write a c++ program to add two numbers by pointers

Page | 12

You might also like