Showing posts with label let us c question answers. Show all posts
Showing posts with label let us c question answers. Show all posts

Sunday, 24 July 2011

[chapter 2 part 3]let us c [SOLVED]



[J]([k]in 4th edition) Attempt the following:
(a)Using conditional operators determine:
(1) Whether the character entered through the keyboard is a lower case alphabet or not.
(2) Whether a character entered through the keyboard is a special symbol or not.

click here for Answer!!!


(b) Write a program using conditional operators to determine whether a year entered through the keyboard is a leap year or not.

click here for Answer!!!



(c) Write a program to find the greatest of the three numbers entered through the keyboard using conditional operators.

click here for Answer!!!

Saturday, 23 July 2011

[chapter 1]let us c [SOLVED]


[H]write C programs for the following:

(a)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.

click here for Answer!!!


(b)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.

click here for Answer!!!


(c) 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.

click here for Answer!!!


(d)Temperature of a city in Fahrenheit degrees is input through the keyboard. Write a program to convert this temperature into Centigrade degrees.

click here for Answer!!!


(e) 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.

click here for Answer!!!


(f) Two numbers are input through the keyboard into two locations C and D. Write a program to interchange the contents of C and D.
click here for Answer!!!


(g) 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 ‘%’)


click here for Answer!!!


(h) If a five-digit number is input through the keyboard, write a program to reverse the number.

click here for Answer!!!


(i) 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.

click here for Answer!!!


(k) 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.

click here for Answer!!!


(l) 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.

click here for Answer!!!


(m) If a five-digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits. For example if the number that is input is 12391 then the output should be displayed as 23402.

click here for Answer!!!