CS13002 Programming and Data Structures

Section: 4/D, Spring 2005

Warm-up exercise

Write a C program that does the following:

Prepare your output on the following six pairs of values of (m,n):

A sample run of your program is given below:

   Enter m : 53
   Enter n : 17
   m + n     = 70
   m - n     = 36
   m * n     = 901
   m / n     = 3 (integer division)
   m % n     = 2 (integer division)
   m / n     = 3.117647 (real division)
   m^2 + n^2 = 3098
   (m + n)^2 = 4900


Course home