You are on page 1of 32

S.

NO DATE TITLE PAGE


NO.
1. 10.2.15 Printing Address using Escape Sequences
3

2. 10.2.15 Summation of Integer Number


5

3. 10.2.15 Summation of First ‘n’ Natural Number


7

4. 10.2.15 Computing the Area of Circle


9

5. 3.3.15 Generation of Multiplication Table


11

6. 3.3.15 Generation of Even Number


13

7. 3.3.15 Generation of Odd Number


15

8. 4.3.15 Checking the status of the student with respect to


mark 17

9. 4.3.15 Computing the Grade of the Student


20

10. 4.3.15 Checking whether the given number is Positive or


Negative 23

11. 17.3.15 Computing the Grade of Student by using Nested If


Structure 25

12. 17.3.15 Sum of Digit using While Loop


28

13. 24.3.15 Printing Arithmetic operation using Do…While Loop


31

Index

Program Status:

Signature of the course Teacher:


(D. Packiyaraj)

1
OUTPUT:

25-E,Bharathiyar Nagar

m.c Road,thanjavur

Pincode:613004.

NAME:R.MAHESHWAR REG NO:14209008

2
LAB TASK:01

DATE:12.02.15

Printing Address using Escape Sequences

AIM:

Printing address by using escape sequences.

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:

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

NAME:R.MAHESHWAR REG NO:14209008

3
OUTPUT:

Enter the value for a:22

Enter the value for b:55

Enter the value for c:66

The resultant value is:143

NAME:R.MAHESHWAR REG NO:14209008

4
LAB TASK:02

DATE:21.01.15

Summation of Integer Number

AIM:

To find the summation of integer numbers.

CODING:

#include<stdio.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:

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

NAME:R.MAHESHWAR REG NO:14209008

5
OUTPUT:

Enter the value for n:65

The resultant is :2145

NAME:R.MAHESHWAR REG NO:14209008

6
LAB TASK:03

DATE:10.02.15

Summation of First ‘n’ Natural Number

AIM:

To find the Summation of first natural numbers.

CODING:

#include<stdio.h>

#include<conio.h>

void main()

int n,result;

clrscr();

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

scanf(“%d”,&n);

result=n x (n+1)/2;

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

getch();

RESULT:

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

NAME:R.MAHESHWAR REG NO:14209008

7
OUTUT:

Enter the radius value:3

The area of the circle is:28.2600000

NAME:R.MAHESHWAR REG NO:14209008

8
LAB TASK:04

DATE:10.02.15

Computing the Area of Circle

AIM:

To compute the area 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:

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

NAME:R.MAHESHWAR REG NO:14209008

9
OUTPUT:

MULTILICATION TABLE

1x8=8

2x8=16

3x8=24

4x8=32

5x8=40

6x8=48

7x8=56

8x8=64

9x8=72

10x8=80

NAME:R.MAHESHWAR REG NO:14209008

10
LAB TASK:05

DATE:03.03.15

Generation of Multiplication Table

AIM:

To generate the 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:

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

NAME:R.MAHESHWAR REG NO:14209008

11
OUTPUT:

EVEN NUMBER

10

NAME:R.MAHESHWAR REG NO:14209008

12
LAB TASK:06

DATE:03.03.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:

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

NAME:R.MAHESHWAR REG NO:14209008

13
OUTPUT:

ODD NUMBER

11

13

15

17

19

NAME:R.MAHESHWAR REG NO:14209008

14
LAB TASK:07

DATE:03.03.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:

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

NAME:R.MAHESHWAR REG NO:14209008

15
OUTUT:

Enter the mark value:21

FAIL

NAME:R.MAHESHWAR REG NO:14209008

16
LAB TASK:08

DATE:04.03.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();

17
RESULT:

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

NAME:R.MAHESHWAR REG NO:14209008

18
OUTPUT:

ENTER FIVE MARK

60

70

80

90

50

FIRST CLASS

NAME:R.MAHESHWAR REG NO:14209008

19
LAB TASK:09

DATE:04.03.15

Computing the Grade of the Student

AIM:

To Find 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

20
Printf(“no grade”);

getch();

RESULT:

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

NAME:R.MAHESHWAR REG NO:14209008

21
OUTPUT:

ENTER THE NUMBER:6

THE GIVEN NUMBER IS:POSITIVE

NAME:R.MAHESHWAR REG NO:14209008

22
LAB TASK:10

DATE:4.3.15

Checking whether a given number is Positive or Negative

AIM:

To Find whether a given number is positive or negative.

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:

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

NAME:R.MAHESHWAR REG NO:14209008

23
OUTPUT:

ENTER YOUR FIVE MARK:95

85

98

75

65

First class

NAME:R.MAHESHWAR REG NO:14209008

24
LAB TASK:11

DATE:17.03.15

Checking whether the given number is Positive or Negative

AIM:

To Find 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”);

25
}

else

printf(“no grade”);

getch();

RESULT:

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

NAME:R.MAHESHWAR REG NO:14209008

26
OUTPUT:

ENTER A DIGIT:146

SUM OF DIGIT=11

NAME:R.MAHESHWAR REG NO:14209008

27
LAB TASK:12

DATE:17.03.15

Sum of Digit using While Loop

AIM:

To Find 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();

28
RESULT:

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

NAME:R.MAHESHWAR REG NO:14209008

29
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

NAME:R.MAHESHWAR REG NO:14209008

30
LAB TASK:13

DATE :24.03.15

Printing Arithmetic operation using Do…While Loop

AIM:

Computing arithmetic 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);

31
while (choice==’y’);

getch();

RESULT:

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

NAME:R.MAHESHWAR REG NO:14209008

32

You might also like