You are on page 1of 41

RURAL TECHNOLOGY CENTRE

B.TECH CIVIL ENGINEERING


(2014-2015)
LAB:INTRODUCTION TO COMPUTER
AND PROGRAMMING IN C
(APRIL-2014)
NAME:R.MAHESHWAR
REG NO:14209008
DEARTMENT OF COMUTER SCIENCE AND APPLICATION

GANDHIGRAM RURAL INSTITUTE-DEEMED UNIVERSITY


GANDHIGRAM-624302
S.NO DATE TITLE SIGN
1. 10.2.15 PRINTING YOUR ADDRESS

2. 10.2.15 SUMMATION OF INTEGER NUMBER

3. 10.2.15 SUMMATION OF FIRST n NATURAL


NUMBER
4. 10.2.15 COMUTING THE AREA OF CIRCLE

5. 3.3.15 GENERATION OF MULITILICATION TABLE

6. 3.3.15 GENERATION OF EVEN NUMBER

7. 3.3.15 GENERATION OF ODD NUMBER

8. 4.3.15 CHECKING THE STATUS OF THE STUDENT


WITH RESECT TO MARK
9. 4.3.15 COMPUTING THE GRADE OF THE
STUDENT
10. 4.3.15 CHECKING WHETHER THE GIVEN
NUMBER IS POSITIVE OR NEGATIVE
11. 17.3.15 COMPPUTING THE GRADE OF STUDENT
BY USING NESTED IF STRUCTURE
12. 17.3.15 SUM OF DIGIT USING WHILE LOOP

13. 24.3.15 PRINTING ARITHEMITIC OPERATION


USING DOWHILE LOOP

OUTPUT:
25-E,Bharathiyar Nagar
m.c Road,thanjavur
Pincode:613004.
LAB TASK:01

DATE:12.2.15

PRINT YOUR ADDRESS BY USING C-PROGRAM

AIM:

Print your address by using c-program.

CODING:

#include<stdio.h>

#include<conio.h>

void main()

clrscr();

printf(“25-E,Bharathiyar Nagar\n”);

printf(“m.c Road,thanjavur\n”);

printf(“Pincode:613004\n”);

getch();

RESULT:

Does the program satisfies the aim of the task and executed
sucessfully.

NAME:R.MAHESHWAR REG NO:14209008


OUTPUT:
Enter the value for a:22
Enter the value for b:55
Enter the value for c:66
The resultant value is:143
LAB TASK:02

DATE:21.1.15

SUMMATION OF INTEGER NUMBERS

AIM:

Summation of integer numbers.

CODING:

#include<studio.h>

#include<conio.h>

void main()

int a,b,c,sum;

clrcsr();

printf(“Enter the value for a:”);

scanf(“%d”,&a);

printf(“Enter the value for b:”);

scanf(“%d”,&b);

printf(“Enter the value for c:”);

scanf(“%d”,&c);

sum=a+b+c;

printf(“the resultant value is %d,”sum);

getch();
}

RESULT:

Does the program satisfies the aim of the task and executed
sucessfully.

NAME:R.MAHESHWAR REG NO:14209008


OUTPUT:
Enter the value for n:65
The resultant is :2145
LAB TASK:03

DATE:10.2.15

SUMMATION OF FIRST NATURAL NUMBERS

AIM:

Summation of first natural numbers.

CODING:

#include<stdio.h>

#include<conio.h>

Void main()

int n,result;

clrscr();

printf(“Enter the value for n:”);

scan f(“%d,&n);

result=nX(n+1)/2;

printf(“the resultant is:%d”,result);

getch();

}
RESULT:

Does the program satisfies the aim of the task and executed
sucessfully.

NAME:R.MAHESHWAR REG NO:14209008


OUTUT:
Enter the radius value:3
The area of the circle is:28.2600000
LAB TASK:04

DATE:10.2.15

COMUPTING THE AREA OF CIRCLE

AIM:

Computing the aera of the circle.

CODING:

#include<stdio.h>

#include<conio.h>

void main()

float pi=3.14;

int rad;

float result;

clrscr();

printf(“Enter the radius value:”);

scanf(“%d”,&rad);

result=pi*rad*rad;

printf(“The area of the circle is %f”,result);

getch();

}
RESULT:

Does the program satisfies the aim of the task and executed
sucessfully.

NAME:R.MAHESHWAR REG NO:14209008


OUTPUT:
MULTILICATION TABLE
1x8=8
2x8=16
3x8=24
4x8=32
5x8=40
6x8=48
7x8=56
8x8=64
9x8=72
10x8=80
LAB TASK:05

DATE:3.3.15

GENERATION OF MULTIPLICATION TABLE

AIM:

Generation of multiplication table.

CODING:

#include<stdiuo.h>

#include<conio.h>

Void main()

int i;

clrscr();

printf(“Multilication Table\n”);

for(i=1;i<=10;i++)

Printf(“%d*%d=%d”,I,8,i*8);

Printf(“\n”);

getch();

}
RESULT:

Does the program satisfies the aim of the task and executed
sucessfully.

NAME:R.MAHEHSWAR REG NO:14209008


OUTPUT:
EVEN NUMBER
2
4
6
8
10
LAB TASK:06

DATE:3.3.15

GENERATION OF EVEN NUMBER

AIM:

Generation of even number.

CODING:

#include<stdio.h>

#include<conio.h>

Void main()

int i;

clrscr();

printf(“Even Number\n”);

for(i=1;i<=20;i++)

If(i%2==0)

Printf(“%d”,i);

Printf(“\n”);

getch();

}
RESULT:

Does the program satisfies the aim of the task and executed
successfully.

NAME:R.MAHEHSWAR REG NO:14209008


OUTPUT:
ODD NUMBER
1
3
5
7
9
11
13
15
17
19
LAB TASK:07

DATE:3.3.15

GENERATION OF ODD NUMBER

AIM:

Generation of odd number.

CODING:

#include<stdio.h>

#include<conio.h>

Void main()

int i;

clrscr();

printf(“odd Number\n”);

for(i=1;i<=20;i++)

If(i%2!=0)

Printf(“%d”,i);

Printf(“\n”);

getch();

}
RESULT:

Does the program satisfies the aim of the task and executed
sucessfully.

NAME:R.MAHEHSWAR REG NO:14209008

OUTUT:
Enter the mark value:21
FAIL

LAB TASK:08
DATE:4.3.15

CHECKING THE STATUS OF THE STUDENT WITH RESPECT TO MARK

AIM:

Checking the status of the student with respect to mark.

CODING:

#include<stdio.h>

#include<conio.h>

Void main()

int mark;

clrscr();

printf(“Enter the mark value:”);

scanf(“%d”,&mark);

if(mark>=35)

Clrscr();

Printf(“pass”);

else

Printf(“fail”);
}

getch();

RESULT:

Does the program satisfies the aim of the task and executed
sucessfully.

NAME:R.MAHESHWAR REG NO:14209008


OUTPUT:
ENTER FIVE MARK
60
70
80
90
50
FIRST CLASS

LAB TASK:09
DATE:4.3.15

COMUTING THE GRADE OF THE STUDENT

AIM:

Computing the grade of the student.

CODING:

#include<stdio.h>

#include<conio.h>

Void main()

int m1,m2,m3,m4,m5,total;

Float average;

clrscr();

printf(“Enter five marks\n”);

scanf(“%d%d%d%d%d”,&m1,&m2,&m3,&m4,&m5);

total= m1+m2+m3+m4+m5;

average=total/5.0;

if(average>=90)

printf(“Distinction”);

else if(average >=70&& average<=89)


{

Printf(“first class”);

else

Printf(“no grade”);

getch();

RESULT: Does the program satisfies the aim of the task and
executed sucessfully.

NAME:R.MAHESHWAR REG NO:14209008

OUTPUT:
ENTER THE NUMBER:6
THE GIVEN NUMBER IS:POSITIVE

LAB TASK:10
DATE:4.3.15

CHECKING WHETHER A GIVEN NUMBER IS +VE (OR) –VE

AIM:

Checking whether a given number is +ve(or)-ve.

CODING:

#include<stdio.h>

#include<conio.h>

Void main()

int i;

clrscr();

printf(“Enter the number”:);

scanf(“%d”,&i);

if(i>=0)

Printf(“The given number is positive”);

else

Printf(“The given number is negative”);

}
getch();

RESULT: Does the program satisfies the aim of the task and
executed sucessfully.

NAME:R.MAHESHWAR REG NO:14209008

OUTPUT:
ENTER YOUR FIVE MARK:95
85
98
75
65
First class

LAB TASK:11
DATE:17.3.15
COMPUTING THE GRADE OF STUDENT BY USING NESTED IF
STRUCTURE.

AIM:

Computing the grade of student by using nested if structure.

CODING:

#include<stdio.h>
#include<conio.h>
Void main()
{
int m1,m2,m3,m4,m5,total;
Float average;
clrscr();
printf(“Enter five marks\n”);
scanf(“%d%d%d%d%d”,&m1,&m2,&m3,&m4,&m5);
total= m1+m2+m3+m4+m5;
average=total/5.0;
if(m1>=35&&m2>=35&&m3>=35&&m4>=35&&m5>=35)
{
if(average>=90&&<=100)
printf(“Distinction”);
else if(average >=70&& average<=89)
Printf(“first class”);
else if(average>=60&&average<=69)
printf(“second class”);
else
printf(“third clasds”);
}
else
Printf(“no grade”);
getch();
}

RESULT: Does the program satisfies the aim of the task and
executed sucessfully.

NAME:R.MAHESHWAR REG NO:14209008

OUTPUT:
ENTER A DIGIT:146
SUM OF DIGIT=11

LAB TASK:12
DATE:17.3.15

SUM OF DIGIT USING WHILE LOOP.

AIM:

Sum of digit using while loop.

CODING:

#include<stdio.h>

#include<conio.h>

Void main()

int n,sum=0,k;

clrscr();

printf(“Enter digit”);

scanf(“%d,”&n);

while(n>0)

k=n%10;

sum=sum+k

n=n/10;

Printf(“sum of the digit=%d”,sum);

getch();
}

RESULT: Does the program satisfies the aim of the task and
executed sucessfully.

NAME:R.MAHESHWAR REG NO:14209008

OUTPUT:
Enter a&b value :15 8
Sum of a&b:23
Sub of a&b:7
mul of a&b:120
div of a&b:1
Do you want to continue?:N

LAB TASK:13
DATE:24.3.15

PRINTING ARITHEMITIC OPERATION USING DO WHILE LOOP.

AIM:

Printing arithemitic operation using do while loop.

CODING:

#include<stdio.h>

#include<conio.h>

Void main()

int a,b,c,d,e,f:char choice;

do

clrscr();

printf(“entre a&b values:”);

scanf(“%d%d,&a,&b);

c=a+b;

printf(“\n sum of a&b=%d”,c);

d=a-b;

printf(“\n sub of a&b=%d”,d);

e=a*b;

printf(“\n multi of a&b=%d”,d);


f=a/b;

printf(“\n div of a&b=%d”,f);

printf(“\n\n do you to continue?:”);

scanf(“%s”,&choice);

While (choice==’y’);

getch();

RESULT: Does the program satisfies the aim of the task and
executed sucessfully.

NAME:R.MAHESHWAR REGNO:14209008

You might also like