Posts

Showing posts from July 25, 2012

Arithmatic Operation

Write and run a program that reads a six digit integer and prints the sum of its six digits. Use the quotient operator(/) and the remainder operator(%) to extract the digit from the integer. For example, if N is the integer 876543 then n/1000%10 is its thousands digit 6. << Go to Index Page >>

Conditional Expression

Write and run a program that reads two integers and then uses the conditional expression operator to print either "Multiple" or "Not" according to whether one of the integers is a multiple of the other. << Go to Index Page >>

Comparison Operator

Write and run a program that reads the users age and then prints "You are a Child" if the age < 18, " You are an adult." if 18<=age<65, and "You are a senior citizen." if age >=65. << Go to Index Page >>