0% found this document useful (0 votes)
2 views1 page

C++ Variables and Data Types Exercises

The document contains assignment questions focused on variables and data types in programming. It includes tasks such as calculating the area of a square, total cost of items with optional GST, a simple interest calculator, and the area of a circle. The purpose of these questions is to practice logical thinking in C++ rather than mathematical skills.

Uploaded by

Keshav Keshav
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

C++ Variables and Data Types Exercises

The document contains assignment questions focused on variables and data types in programming. It includes tasks such as calculating the area of a square, total cost of items with optional GST, a simple interest calculator, and the area of a circle. The purpose of these questions is to practice logical thinking in C++ rather than mathematical skills.

Uploaded by

Keshav Keshav
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Variables & Data Types

(Assignment Questions)

keshavkeshav1611@[Link]
Question 1 : In a program, input the side of a square. You have to output the area of
the square.
Input : n (side)
Output : n*n (area)

Question 2 : Enter cost of 3 items from the user (using float data type) - a pencil, a
pen and an eraser. You have to output the total cost of the items back to the user as
their bill.
(Add on : You can also try adding 18% GST tax to the items in the bill as an advanced
problem)

Question 3 : Build a Simple Interest Calculator.


Input : principal (P), rate (R), time (T)
Output : (P*R*T) / 100

Question 4 : Write a program to calculate the area of a circle.


Input : r (radius)
Output : PI*r*r (area)

Note - These questions are only to help you practice the concepts of this chapter.
These are not designed to test your mathematical skills, just to understand logic
building using C++.

You might also like