Practice C++ programming with coding exercises covering variables, data types, operators, input and output, type casting, conditional statements, loops, functions, arrays, and other C++ fundamentals.
Write a C++ program that takes the student’s name, age, and marks as input and displays them using cout.
Write a C++ program that takes the prices of three items from the user, calculates the total, and displays the result.
Write a C++ program that takes the length and width of a rectangle and calculates:
Perimeter = 2 × (Length + Width)
Display the result using cout.
Write a C++ program that takes marks of three subjects, calculates the average, and displays the result.
Write a C++ program that asks the user to enter their age and displays:
Your age is: 20
Write a C++ program that takes two integers from the user and displays their:
Write a C++ program that takes marks of three subjects and displays the total marks.
Write a C++ program that takes the length and width of a rectangle and calculates its area.
Formula:
Area = Length × Width
Write a C++ program that takes the following information from the user:
Then display all the information using cout.
endlWrite a C++ program that displays your:
Use endl to print each item on a separate line.
setwWrite a C++ program to display the following table using setw(10):
Number Cube
2 8
3 27
4 64
5 125
Write a C++ program that uses both endl and setw() to display a simple student information table containing: