(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.
(h) If a five-digit number is input through the keyboard, write a program to reverse the number.
Reading through the Phillips Library catalog is an activity that is simultaneously enticing and frustrating: one can glean the scope of the collections but not access them, provenances are presented but not deeds of gift or deposit (which is standard). Given the missions of its two founding institutions, the Essex Institute and the Peabody Museum, […]
(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 ‘%’)
(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.
For as complex a story as Tony Young’s, the most powerful element was the textual element – the written piece itself. Reporter Cindy Chang begins the story with a narrative-styled approach to Young’s last day. She first provides a vivid image of him stepping out of a noodle shop and then ends the lead with […]
(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.