Program Listno-1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

C- PROGRAM LIST-1 TOKENS & I/O IN ‘C’

1. WAP to display a message “ Welcome in programming world”.


2. WAP to display your name at middle of the screen.
3. WAP to input & display your name, address, father’s name & phone number.
4. WAP to input & display your date of birth.
5. WAP to perform simple addition of pre-initialized value of two variables.
6. WAP to perform division a/b by taking float values from user.
7. WAP to convert distance from meter value to centimeters, kilometers, inches & feet values.
8. WAP to find average of five numbers.
9. WAP to convert temperature from Celsius to Fahrenheit & Kelvin.
10. WAP to convert weight from kg to pound, gram, milligram, tone & ounce.
11. WAP to convert area from feet2 to cm2 m2, inch2, yard2, acre2 mile2 & hectare2.
12. WAP to convert & display decimal number into hexadecimal & octal number by using %X & %O data
type identifiers.
13. WAP to convert & display hexadecimal into decimal & octal number by using %d & %O data type
identifiers.
14. WAP to convert & display octal number into hexadecimal & decimal number by using %d & %X data
type identifiers.
15. WAP to input a character & display it’s ASCII number.
16. WAP to input a ASCII number & display it’s character.
17. WAP to input 5 item with its price & display in following manner
*** list of items***
Item name price
Sugar 25.25/-
Rice 40.50/-
----- -------
18. WAP to swap two numbers by using third variable.
19. WAP to swap two numbers without using third variable.
20. WAP to input a character without echo on screen & after that display that character in “ “.
21. Write separate programs for evaluating following expression by taking necessary input from user.
1. input a, b, c & d & calculate Z=
2. Input m, n, a & b & calculate Z=
3. Input x & calculate Z=
4. Input a, b, c, d, & e & calculate Z=

5. Input B, Y, x, d, z, & y and calculate Z=

22. Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary,
and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.
23. If the marks obtained by a student in five different subjects are input through the keyboard, find out the
aggregate marks and percentage marks obtained by the student. Assume that the maximum marks that
can be obtained by a student in each subject is 100.
24. The length & breadth of a rectangle and radius of a circle are input through the keyboard. Write a
program to calculate the area & perimeter of the rectangle, and the area & circumference of the circle.
25. If a five-digit number is input through the keyboard, write a program to calculate the sum of its digits.
(Hint: Use the modulus operator ‘%’)
26. If a five-digit number is input through the keyboard, write a program to reverse the number.
27. If a four-digit number is input through the keyboard, write a program to obtain the sum of the first and
last digit of this number.
28. In a town, the percentage of men is 52. The percentage of total literacy is 48. If total percentage of
literate men is 35 of the total population, write a program to find the total number of illiterate men and
women if the population of the town is 80,000.
29. A cashier has currency notes of denominations 10, 50 and 100. If the amount to be withdrawn is input
through the keyboard in hundreds, find the total number of currency notes of each denomination the
cashier will have to give to the withdrawer.
30. 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.

TIETECH JBP... 1 Mo-9993204476

You might also like