Lab 1

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

First Question

#include <stdio.h> // Library //

void main()

printf("Qais Abu Hamad \n"); // print on the screen//

printf("ID 23591 \n");

printf("My birthday 5/1/1988 \n");

}
Second Question

#include <stdio.h> //library//

void main() // program that calculates two numbers enterd by the user //
{
int num1; // Declaration //

int num2; // Declaration //

int num3; // Declaration //

int num4; // Declaration //

int num5; // Declaration //

printf("Enter The First Number \n"); // ask the user to enter two nums//

scanf("%d", &num1); // creates a place to store the num entered by the user //

printf("Enter The Second Number \n");

scanf("%d", &num2);

num3=num1+num2; // equations defined //


num4=num1-num2;
num5=num1*num2;

printf("Summation %d \n", num3);


printf("Difference %d \n", num4);
printf("Multiplucation %d \n", num5);

}
Third Question

#include <stdio.h> // library//

void main() // same as pervious program but with AUS header //

int num1; // Declaration //

int num2; // Declaration //

int num3; // Declaration //

int num4; // Declaration //

int num5; // Declaration //


printf("American University of Sharjah \n"); // header//

printf(" School of Engineering \n"); // header//

printf("Mechanical Engineering Department \n") ; // header//

printf(" MCE 234 \n"); // header//

printf(" FALL 2009 \n"); // header//

printf("Enter The First Number \n");

scanf("%d", &num1);

printf("Enter The Second Number \n");

scanf("%d", &num2);

num3=num1+num2; // calculation //

num4=num1-num2;

num5=num1*num2;

printf("Summation %d \n", num3);

printf("Difference %d \n", num4);

printf("Multiplucation %d \n", num5);

You might also like