You are on page 1of 4

EXPERIMENT # 01

TITLE: INTRODUCTION TO “C”


INTRODUCTION:
C is a general purpose high level language that was originally developed by Dennis Ritchie. It is
use to develop system applications that forms major portion of operating systems such as
Windows, UNIX and linux.

OBJECTIVES:
The main purpose of this course is to introduce to students is to learn programming using “C”
language. By learning this language we should improve our skills in programming and we are
able to write programs in “C”
POST LAB TASKS:
Task 1:
Write a program that print this
@@@@@@@@@
@@@@@@@@@
*** Your Name ***
@@@@@@@@@
@@@@@@@@@
#include <stdio.h>
#include <stdlib.h>

int main()
{
printf("\n\t@@@@@@@@@@@@@@@@@\n\t@@@@@@@@@@@@@@@@@\n\t
***SAAD BIN
RIAZ***\n\t@@@@@@@@@@@@@@@@@\n\t@@@@@@@@@@@@@@@@@\n\t");
return 0;
}
TASK 2:
Write a program that calculate the area of triangle and rectangle by taking the values length and
width as input, where formulas are given below.
Area of triangle = ½( length * width )
Area of rectangle = length * width
#include <stdio.h>
#include <stdlib.h>

int main()
{

int length,width,Area1,Area2;

printf("\nEnter the value of length");


scanf("%d",&length);
printf("\nEnter the value of width");
scanf("%d",&width);
/* FORMULA OF AREA OF RECTANGLE*/
Area1=length*width;
printf("\n%d*%d=%d Area1",length,width,Area1);
/*FORMULA OF AREA OF TRIANGLE*/
Area2=(length*width)/2;
printf("\n%d/2*%d/2=%d Area2",length,width,Area2);
return 0;

You might also like