0% found this document useful (0 votes)
17 views

Itc Assignment 2

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)
17 views

Itc Assignment 2

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/ 7

1) Write a program in C++ to find the sum of first 20 even numbers

2) Write a program in C++ to check whether a number is prime or not.


3). Write a program in C++ to count the prime number from 1 to 100.

4) Write a program in C++ to find the factorial of a number.


5) Write a program in C++ to display the cube of the number up to given an integer.

6). Write and run a program that simulates a simple calculator. It reads two integers and a
character. If the character is a ‘+’, the sum is printed; if it is a ‘-‘, the difference is printed; if it
is a ‘*’, the product is printed; if it is a ‘/’, the quotient is printed; and if it is a ‘%’, the
remainder is printed
7) The UCP has decided to give some increments to all its employees on the basis of their
experience with the following criteria.
a. 0 years - No increment
b. 1-5 years - 10%
c. 6-10 years – 20%
8) Write a program which keeps taking input from user until user enters a character ‘0’
and checks that how many times character ‘a’ has been entered.
9) Write a program in C++ to find the number and sum of all integer between 100 and
200 which are divisible by 9.
10) Write a C++ program that calculates the sum of a series of numbers entered by the
user. The program should continue to prompt the user to enter numbers until the sentinel
value -99 is entered. Once the sentinel value is detected, the program should terminate the
input process and display the sum of all the entered numbers

You might also like