Program 1:: Write A Program That Inputs A Decimal Number and Converts It To Binary Digits
Program 1:: Write A Program That Inputs A Decimal Number and Converts It To Binary Digits
Write a program that inputs a decimal number and converts it to binary digits.
Program 2:
Write a C++ program that calculates percentage, GPA and grade of a student. Your
program should prompt the user to enter total marks and marks obtained in three
subjects.
Then program will calculate percentage and GPA for each subject based on entered
total and obtained marks and will display the result on output screen.
After calculating percentage and GPA of three subjects, calculate semester GPA (called
CGPA) and the grade of student obtained in semester and display it on the screen.
Formula to calculate Subject percentage: Marks Obtained *100 / TotalMarks
Formula to calculate Subject GPA: Percentage Marks * 5 / 100
Formula to calculate CGPA: Subject1GPA + Subject2 GPA + Subject3 GPA] / 3
Program 3:
Write a C++ program to prompt the user to input 3 integer values and print these values
in forward and reversed order, as shown below.
Program 5:
Program 6:
Program 8:
Program 9:
Program 10:
Write a program in C++ to find the area of any triangle using Heron's Formula
Program 11:
Program 12:
Program 13:
Write a program in C++ that converts kilometers per hour to miles per hour
Program 14:
Write a language program which accepts the radius of a circle from the user and
compute the area and circumference
Program 15:
Write a program in C++ to enter length in centimeter and convert it into meter
and kilometer.
Program 16:
Write a C++ program to swap first and last digits of any number.
Sample Output:
Input any number: 12345
The number after swapping the first and last digits are: 52341
Program 17:
Write a C++ program that input three numbers from the user and print them in
descending sort order.
Program 18:
Write a C++ program to replace all the lower-case letters of a given string with
the corresponding capital letters
Program 19:
Write a program that get a 5 digits number from and user and print the sum of
different digits.
Program 20:
Write a C++ program that accepts various numbers and compute the difference
between the highest number and the lowest number. All input numbers should be
real numbers between 0 and 1,000,000. The output (real number) may include
an error of 0.01 or less
Program 21:
Write a C++ program to display number of leap years between two given years. If
there is no leap year in the given period, display a suitable message
Program 22:
Write a function that accept a salary and return the tax according to following
rules:
A pharmaceutical company pays 10% house rent of basic salary & 90% daily
allowance of basic salary to its employees if the basic pay of the employes is less
than 1500.the company pays 20% house rent & 95% daily allowance of basic
salary if the basic pay of the employee is greater than or equal to 1500
Write a program that takes basic salary of an employee and calculate & print his
gross salary.
Program 24:
Write a program that takes the lengths of the two legs of a right triangle as input
and calculates area and hypotenuse
Program 25:
Write a program that creates a simple calculator.it reads two float numbers
N1,N2 and a character CH(+,-,*,/),then perform calculation depending upon the
type of character entered by user and display result in format …N1 op N2=result
Program 26:
01/01/1990, the day was Monday. If any date enter(ie 05/04/2005) is input
through keyboard ,write a program to find out day of that date.
Program 27:
Write a program that input an integer and checks number is perfect ,deficit or
abundant
Program 28:
Write a program that takes sale price and cost price as input from the user and
then it tells whether the person has made profit or loss? Also calculate the
amount of profit or loss made.
Program 29:
Write a program that takes gross salary and age as input from the user and then
Program 30:
Write a program that takes number of hours worked in a week and then
calculates the salary based on the following conditions;
• If hours<50, pay = Rs. 150/hour
• If hours>50;
Program 31:
Write a program that the displays the names of islamic months (and tells the user ;which
islamic month is the first, second etc on user's demand)and so on.
Program 32:
Write a program that convert STANDARD time to MILITARY time
Program 33:
Write a program that check number is even or odd. Don’t use if statement
Program 34:
Write a program that input 6 numbers from the user and display the smallest no’s on
screen using nested if
Program 35:
Write a program that takes age in years from user and converts it into minutes.
Program 36:
Write a program that take 2 no from user and tell the numbers are in which quadrant or
at the origin.
Program 37:
Write a program that inputs two numbers and finds if second I the square of first?
Program 38:
Write a program that checks whether number is Armstrong or not?
An Armstrong number is an n-digit base b number such that the sum of its (base b)
digits raised to the power n is the number itself. Hence 153 because 13 + 53 + 33 = 1 +
125 + 27 = 153.
Program 39:
Write a program that checks whether number is Perfect or not?
Perfect number, a positive integer that is equal to the sum of its proper divisors. The
smallest perfect number is 6, which is the sum of 1, 2, and 3.
Program 40:
Write a C++ program to solve the second degree equation A X2+B X + C = 0, where
the inputs are the coefficients A, B and C
Program 41:
Write a program to perform date arithmetic, such as how many days there are between
6/1/90 and 8/3/92. Include a specification and a code design .
Program 42:
A serial transmission line can transmit 960 characters a second. Write a program that
will calculate how long it will take to send a file, given the file's size. Try it on a 400MB
(419,430,400 byte) file. Use appropriate units. (A 400MB file takes days.)
Program 43:
Write a C++ program to calculate the area of a triangle with sides a, b and c.
Program 44:
Write a program to find Maximum and minimum of two numbers without using any loop
or condition.
Program 45:
Write a program to find sum of two integers without using ‘+’ operator.