-
Calculate the salary of an employee who works on an hourly basis. The formula to be used is
Salary = Hours worked * Pay rate. -
Write a Problem Analysis Chart (PAC) to convert the length in inches to centimeters where
1 inch = 2.54cm. -
Write a Problem Analysis Chart (PAC) to find an area of a circle where
area = pi * radius * radius. -
Write a Problem Analysis Chart (PAC) to find the sum of two numbers.
-
Write a program to calculate simple interest for a set of values representing principle, number of years, and rate of interest. The formula for computing simple interest is
si = p * n* r / 100. -
Ramesh's basic salary is input through the keyboard. His dearness allowance is 40% of his basic salary and his house rent allowance is 20% of his basic salary. Write a program to calculate his gross salary.
-
Temperature of a city in Fahrenheit is input through the keyboard. Write a program to convert it into Centigrade.
-
Write a program to calculate the area and circumference of a circle.
-
The distance between two cities (in km) is input through the keyboard. Write a program to convert and print this distance in meters, feet, inches, and centimeters.
-
The length and breadth of a rectangle and the radius of a circle are input through the keyboard. Write a program to calculate the area and perimeter of the rectangle and the area and circumference of the circle.
-
If a five-digit number is input through the keyboard, write a program to calculate the sum of its digits.
-
If a five-digit number is input through the keyboard, write a program to reverse the number.
-
Two numbers are input through the keyboard into two memory locations C and D. Write a program to interchange the contents of C and D.
-
If a four-digit number is input through the keyboard, write a program to obtain the sum of the first and last digits of this number.
-
If the total selling price of 15 items and the total profit earned on them is input through the keyboard, write a program to find the cost price of one item.
-
While purchasing certain items, a discount of 10% is offered if the quantity purchased is more than 1000. If quantity and price per item are input through the keyboard, write a program to calculate the total expenses.
-
In a company an employee is paid as under:
- If his basic salary is less than Rs. 1500, then HRA = 10% of basic salary and DA= 90% of basic salary.
- If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500, and DA = 98% of his basic salary.
If the employee's salary is input through the keyboard write a program to find his gross salary.
-
The marks obtained by a student in 5 different subjects are input through the keyboard. The student gets a division as per the following rules:
- Percentage above or equal to 60 First division
- Percentage between 50 and 59 Second division
- Percentage between 40 and 49 Third division
- Percentage less than 40 - Fail
Write a program to calculate the division obtained by the student.
-
Write a program to calculate the salary as per the following table:
Gender Years of service Qualifications Salary Male >= 10 Post-Graduate 15000 >= 10 Graduate 10000 < 10 Post-Graduate 10000 < 10 Graduate 7000 Female >= 10 Post-Graduate 12000 >= 10 Graduate 9000 < 10 Post-Graduate 10000 < 10 Graduate 6000 -
Any character is entered through the keyboard, write a program to determine whether the character entered is a capital letter, a small case letter, a digit, or a special symbol. The following table shows the range of ASCII values for various characters:
Characters ASCII Values A-Z 65-90 a-z 97-122 0-9 48-57 special symbols 0-47 58-64 91-96 123-127 -
An Insurance company follows the following rules to calculate the premium.
- If a person's health is excellent and the person is between 25 and 35 years of age and lives in a city and is a male then the premium is Rs. 4 per thousand and his policy amount cannot exceed Rs. 2 lakhs.
- If a person satisfies all the above conditions except that the sex is female then the premium is Rs. 3 per thousand and her policy amount cannot exceed Rs. 1 lakh.
- If a person's health is poor and the person is between 25 and 35 years of age and lives in a village and is a male then the premium is Rs. 6 per thousand and his policy cannot exceed Rs. 10,000.
- In all other cases the person is not insured.
Write a program to output whether the person should be insured or not, his/her premium rate, and the maximum amount for which he/she can be insured.
-
If the ages of Ram, Shyam, and Ajay are input through the keyboard, write a program to determine the youngest of the three.
-
A certain grade of steel is graded according to the following conditions:
- Hardness must be greater than 50
- Carbon content must be less than 0.7
- Tensile strength must be greater than 5600
The grades are as follows:
- Grade is 10 if all three conditions are met Grade is 9 if conditions 1 and 2 are met
- Grade is 8 if conditions 2 and 3 are met
- Grade is 7 if conditions 1 and 3 are met
- Grade is 6 if only one condition is met
- Grade is 5 if none of the conditions are met
Write a program, which will require the user to give values of hardness, carbon content, and tensile strength of the steel under consideration and output the grade of the steel.
-
Using Conditional operators determine:
- Whether the character entered through the keyboard is an Upper case alphabet or not
- Whether the character entered through the keyboard is a special symbol or not
-
Write a program using conditional operators to determine whether a year entered through the keyboard is a leap year or not
-
Write a program to find the greatest of the three numbers entered through the keyboard. Use conditional Operators
-
If the cost price and selling price of an item is input through the keyboard, write a program to determine whether the seller has made a profit or incurred a loss. Also, determine how much profit he made or the loss he incurred.
-
Given the coordinates (x, y) of a center of a circle and its radius, write a program that will determine whether a point lies inside the circle, on the circle, or outside the circle.
-
Write a program to find the factorial value of any number entered through the keyboard.
-
Two numbers are entered through the keyboard. Write a program to find the value of one number raised to the power of another.
-
Write a program to enter the numbers till the user wants and at the end, it should display the count of positive, negative, and zeros entered.
-
Write a program to find the sum of the digits of a number.
-
Write a program to find whether the given number is Armstrong or not.
-
Write a program to generate the series
* * * * * * * * * * * * * * * -
Write a program to generate the series
1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 -
Write a program to generate the series
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 -
Write a program to generate the series
* * * * * * * * * * * * * * * -
Program to print all Armstrong numbers between 1 to 1000.
-
Find the factorial value of any number.
-
Write a program to generate the series
A B C D E F G F E D C B A A B C D E F F E D C B A A B C D E E D C B A A B C D D C B A A B C C B A A B B A A A -
Write a program to check whether a given number is prime or not.
-
Write a program to generate all prime numbers between 1 to 1000.
-
Write a program to calculate the sum of numbers (max 10 numbers). If the user enters a negative number loop terminates.
-
Write a program that reads in 2 numbers x and y, and prints the largest common divisor of both x and y
-
Write a program that reads in an integer n and prints all its divisors.
-
Write a program that inputs a number (1-7) and prints the corresponding day of the week (switch case).
-
Write a program that inputs a number (1-12) and the corresponding month of the year (switch case).
-
Write a program that inputs the power (in watts) and outputs the lifespan of an electrical appliance. (switch case).
- If watts = 25: lifespan = 2500
- If watts = 40 or 60: lifespan = 1000
- If watts = 75: lifespan = 700
- Otherwise: lifespan = 0
-
If the lengths of the sides of a triangle are denoted by a, b, and c, then the area of the represented triangle =
√(S(S-a)(S-b)(S-c)), whereS=(a+b+c)/2. Write a program to calculate the area of a triangle. -
Make a menu-driven program with the following functions:
- Check if the number is prime or not
- Check if the number is Armstrong or not
- Find the factorial of the number
- Exit
-
Write a menu-driven program to perform a simple calculation on two numbers (addition, subtraction, multiplication, division).
-
Write a menu-driven program to compute the areas of the various geometrical shapes.
-
Write the program using switch-case to simulate traffic lights: R = STOP!, Y = CAUTION!, G = GO!
-
Write a program to calculate X to the power Y using the inbuilt power function.
-
Determine sin(x), cos(x) and tan(x) values for x=0, x=30, x=60, x=90. The output should be displayed as follows:
X=0 X=30 x=60 x=90 sin(x) cos(x) tan(x) -
getc(),getch(),getchar()andgetche()are some of the functions related to characters. Determine what is their functionality. Create a program including all these inbuilt functions. -
Write a function to perform the addition on two numbers. (Hint: function with arguments and with return value.)
-
Write a program to check whether a year is a leap year or not using functions.
-
Write a program to find the sum of the squares of the first n numbers and calculate its sum.
-
Write a program to calculate
1/1! + 2/2! + 3/3! + 4/4! + ... + n/n! -
Write a function that receives a
floatand anintfrommain(), finds the product of these two, and returns the product which is printed throughmain(). (Hint: Function with arguments and with return type.) -
Write a function that receives 5 integers and returns the sum, the average, and the standard deviation of these numbers. Call this function from
main()and print the results inmain().
σ = √Σ(x - μ))whole to the power 2 / N
where- σ = population standard deviation
- N = the size of the population
- X = each value from the population
- μ = the population mean
-
Write a function that receives marks received by a student in 3 subjects and returns the average and percentage of these marks. Call this function from
main()and print the results inmain(). (Hint: Function with arguments and with return type.) -
Write a recursive function to obtain the first 25 numbers of a Fibonacci sequence. In a Fibonacci sequence, the sum of two successive terms gives the third term. Following are the first few terms of the Fibonacci sequence:
1 1 2 3 5 8 13 21 34 55 89...(Hint: Function with no arguments and no return type.)
-
Notifications
You must be signed in to change notification settings - Fork 3
pranavkanth/Learning-Codes
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
lo bhai
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published