You are on page 1of 1

F60C44- Introduction to C Programming

Review questions

a) Write a program to read two real numbers. Display the biggest number.

b) Write a program to read two integer numbers. Display whether the numbers are odd or
even.

c) Write a program to read user’s name and gender. Input for gender is a single character (M-
Male and F- Female). You program should print the output as shown below based on the
gender.

Enter your name : John Smith


Enter your gender [M-Male, F-Female] : m

Hello, Mr. John Smith

Enter your name : Ann


Enter your gender [M-Male, F-Female] : F

Hello, Ms. Ann

d) Write a program to read numbers from 1 to 10. Your program should decide whether the
number is below 1 or above 10.

e) Write a program to read an integer value. Your program should determine whether the
number is positive, negative or zero.

f) Write a program to find the sum, average and product of two numbers.

g) Write a program to print odd numbers from 1 to 10.

h) Write a program to accept 10 real numbers. Find the average of the entered vales.

You might also like