Nt1210 Lab 1 Essay

560 Words3 Pages
Lab 1 This lab exercise covers: * an introduction to C programming * arithmetic statements * Standard input output * Mathematical functions Exercise 1.1 Write a program that prints the string “Computing Systems & Programming” to the screen, reads an integer from the keyboard, and print the integer to the screen. Exercise 1.2 Write the following program. Compile, link and run it. #include<stdio.h> int main () { int year; float height; year = 21; height = 1.77; printf("Ali is %d years old and %f meter height\n", year, height); return 0; } Exercise 1.3 Write a program that demonstrates the use of the +,-,* and / operators for integers. Type the following program. Compile, link and run it.…show more content…
printf("i=%d\n",i); i= i* j * 2; //Integer multiplication. printf("i=%d\n",i); j= i / 10; //Integer division printf("j=%d\n",j); return 0; } Exercise 1.4 Write a program that demonstrates the use of the +,-,* and / operators for floating point numbers. Type the following program. Compile, link and run it. #include <stdio.h> int main(

More about Nt1210 Lab 1 Essay

Open Document