Code Like Pro!
Basic Input Output
- Risabh’s basic salary is given as input through the keyboard. His dearness allowance is 25% of basic salary, house rent allowance is 15% of basic salary and provident fund is 7.5% of basic salary. Write a program to calculate his gross salary.
- Write a program which takes a Fahrenheit temperature as input and prints the equivalent Celsius temperature.
- Write a program to receive Cartesian coordinates (x,y) of a point and convert them to polar coordinates (r,φ). (Hint: r = sqrt (x2 + y2) and φ = tan-1(y/x))
- Write a program which takes two integers as input, which denote meters and centimeters, and converts this distance into feet and inches. (Hint: 1 Inch = 2.54 Centimeters and 12 Inches = 1 Foot)
- Write a program which takes the principal amount, rate of interest and number of years and calculates the amount after the entered number of years if the principal amount is compounded quarterly at the entered rate of interest for the entered time.
- Write a program to swap or interchange the contents of two integer variables, using a third variable.
- Write a program to swap or interchange the contents of two integer variables, without using a third variable.
- Write a program to calculate the sum of the series: 1+2+3+4+…+n, where n is entered by the user, without using iteration or recursion. (Hint: Use Summation of Arithmetic Progression)
- Write a program to calculate the sum of the series: 1+2+4+8+…+2n, where n is entered by the user, without using iteration or recursion. (Hint: Use Summation of Geometric Progression)
- If the lengths of 3 sides of a triangle are provided as input, write a program to find the three angles of the triangle. (Hint: Use Coisine Formula)
Find the solutions here.
You are supposed to write the code for all problems and then check the solution file. The code present in the solution is supposed to be the best and most efficient code. You can mail your solution to me on ankan.learncwithme@gmail.com and I'll surely check it and if I find it better I'll put it in the solution.
Previous
Next