0% found this document useful (0 votes)
18 views2 pages

Class Test 6

The document outlines a class test with 9 programming questions ranging from 2-3 marks each. The questions cover topics like input/output, conditional statements, loops, functions, data types, and more.

Uploaded by

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

Class Test 6

The document outlines a class test with 9 programming questions ranging from 2-3 marks each. The questions cover topics like input/output, conditional statements, loops, functions, data types, and more.

Uploaded by

daksh.gupta31983
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Time:50 min Class Test 6 Max Marks 20

1. Input unit and price from the user and find out total amount. 2
2. Input unit and price from the user and find total amount as- 2
if unit discount
>20 20% of total amount
>10 10% of total amount
else no discount
3. Input a number from the user. Check if the number is odd print its double and if the number is even

print its square root. 2


4. Input a number from the user and print reverse counting from that number. 2
5. Write a program to print 1 2 4 8 16 32 64 128. 3
6. Write a C++ program to input principal amount and time. If time is more than 10 years, calculate
the simple interest with rate 8%. Otherwise calculate it with rate 12% per annum. 3
7. Find out syntax error: 2
#include (iostream.h)
void main();
{
int n=10;
square= =n*n
Cout<<square; }
8. What will be the output of the following code fragment?
void main()
{ 1
if(0)
cout<<”bye”;
else
cout<<”Welcome”;
}
9. Write a program to check a number entered by the user is palindrome or not. 3

Time:50 min Class Test 6 Max Marks 20


1. Input unit and price from the user and find out total amount. 2
2. Input unit and price from the user and find total amount as- 2
if unit discount
>20 20% of total amount
>10 10% of total amount
else no discount
3. Input a number from the user. Check if the number is odd print its double and if the number is even

print its square root. 2


4. Input a number from the user and print reverse counting from that number. 2
5. Write a program to print 1 2 4 8 16 32 64 128. 3
6. Write a C++ program to input principal amount and time. If time is more than 10 years, calculate
the simple interest with rate 8%. Otherwise calculate it with rate 12% per annum. 3
7. Find out syntax error: 2
#include (iostream.h)
void main();
{
int n=10;
square= =n*n
Cout<<square; }
8. What will be the output of the following code fragment?
void main()
{ 1
if(0)
cout<<”bye”;
else
cout<<”Welcome”;
}
9. Write a program to check a number entered by the user is palindrome or not. 3

You might also like