programming i - problems

1
Sheet # 1 Q1: Write C program to print the following text (in the exact format) on the screen: [Hint: use “\t” and “\n” ]: Q2: Write C program to read integer (N), compute the square of N, and print the result. Q3: Write C program to read an input value represents a temperature in Celsius and convert it to Fahrenheit then print the result on screen. [Hint: use the formula: Fahrenheit = ]. Q4: Write C program to read three input integers: A, B & C and print out the largest one on the screen. Q5: Write a program to read two positive integers from user, and then print their Sum, Product, Difference, Division, and Remainder after division. The output will be like: Please, User Enter 2 +ve Numbers: num1 num2 ┘ The sum of num1 and num2 = …… The Product of num1 and num2 = …… The Difference between num1 and num2 = …… The Division of num1 by num2 = …… The Remainder of num1 by num2 = …… * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Programming I Faculty of Computer AUT University

Upload: moustafa-al-kurdi

Post on 23-Jan-2016

220 views

Category:

Documents


0 download

DESCRIPTION

Questions about C Languages.

TRANSCRIPT

Page 1: Programming I - Problems

Sheet # 1

Q1: Write C program to print the following text (in the exact format) on the screen: [Hint: use “\t” and “\n” ]:

Q2: Write C program to read integer (N), compute the square of N, and print the result.

Q3: Write C program to read an input value represents a temperature in Celsius and convert it to Fahrenheit then print the result on screen.

[Hint: use the formula: Fahrenheit = ].

Q4: Write C program to read three input integers: A, B & C and print out the largest one on the screen.

Q5: Write a program to read two positive integers from user, and then print their Sum, Product, Difference, Division, and Remainder after division. The output will be like:

Please, User Enter 2 +ve Numbers:

num1 ┘

num2 ┘

The sum of num1 and num2 = ……

The Product of num1 and num2 = ……

The Difference between num1 and num2 = ……

The Division of num1 by num2 = ……

The Remainder of num1 by num2 = ……

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *Programming I

Faculty of ComputerAUT University

= = = = = = = = = = = = = = = = = = = = = = = = = = = = =