Sie sind auf Seite 1von 100

Department Of Computer Science and Engineering

GE2115-Computer Practice Laboratory -I

Department Of Computer Science and Engineering Sri Rangapoopathi college of engineering

Alampoondi,Gingee T.K, Villupuram Dt.

Department Of Computer Science and Engineering

Bonafide Certificate
This is to certify that this is a bonafide record work done by Mr./Miss.--------------------------------------------Reg.No.----------------------------------------------------------------------------------------------------- as a part of in B.E.,

(Common to All Departments) course in Sri Rangapoopathi College of Engineering, Alampoondi, during the 1st Semester and the record is found to be complete. The record of work is found to be complete and satisfactory.

Head of the Department

Staff in-Charge

Submitted for the practical examination held on----------------------Internal Examiner External Examiner

TABLE OF CONTENT

STAFF EXP No. DATE NAME OF THE EXPERIMENTS PAGE NO MARK INCHARGE

MICROSOFT WORD INTRODUCTION

TABLE OF CONTENT

STAFF EXP No. DATE NAME OF THE EXPERIMENTS PAGE NO MARK INCHARGE

C-PROGRAMS

MICROSOFT WORD

MICROSOFT WORD

Word processor is used to produce documents for business or personal use such as newsletter, reports, letters and essays. We might say that a word processor is an intelligent typewriter. We can type a whole page, make corrections (editing), use up paragraphs in different styles and shapes and columns (formatting) and also check spelling, find and insert synonyms for a word (Thesaurus) and process it in many more ways before we actually put that page to print.

FEATURES OF WORD PROCESSOR


The following are the main features of a word processor: Fast Editing features Permanent storage Formatting features Graphics

Ex.No: Date:

CREATING A WORD DOCUMENT

AIM: To create a document that reflects the newspaper format using Microsoft word. PROCEDURE:
To enter Microsoft word, Click start button then click program from

programs menu then click Microsoft word For opening a word document do the following. Click file menu from the menu bar. From this file menu click new option. This will display the new document. Then for the newspaper format there must be a header and footer for giving heading and page number. This is done by clicking view from the menu bar, from this click header and footer option. Then enter the heading in the header portion and change the font size to big size and then click B button on formatting tool bar so that the header appears bold. Divide page into columns by clicking the format from the menu bar. Then click columns from the menus available under format. In this step the page is divided into your optional columns. Then enter the text. To insert a picture in between the text, click insert from the menu, then click picture and then clip art. From this clip art we can insert any picture. To insert symbols that are not found in the keyboard, click insert from the menu, then click symbols. After adding the text to the document, save the document by clicking the file from the menu bar and click save .When we save the document for the first time name is to be entered and click save

SCREEN SHOTS:

EXERCISE 1: Create the following document

THE HINDU
FAKE STAMP PAPERS SEIZED Two persons were arrested and counterfeit stamp papers seized following a raid conducted on a house in coimbatore A release here said a special team The team also found Found counterfeit stamp papers of Value Rs50000 and Rs1000. counterfeit currency.

EXERCISE 2: Insert the following mathematical formula and equations in the document (a+b)(a-b)=a2-b2

(a+b)2=a2+b2+2ab 2H2+O2->2H2O Insert the symbols like , , in your document EXERCISE 3: To create a resume. Sample document is given below.

RESULTS: Thus the above experiments are successfully done using Microsoft Word and output is verified.

Ex.No: Date:

CREATING A TABLE

AIM: TO create a table using Microsoft word. PROCEDURE:


To enter Microsoft word, Click start button then click program from

programs menu then click Microsoft word


For opening a word document do the following. Click file menu from the

menu bar. From this file menu click new option. This will display the new document. Enter the heading, change the font size. Click the B button on the formatting tool bar so that the heading appears bold.
To change the font colors click A button on the drawing tool bar and select the

required colors. To insert a table click Table from the menu, then click insert, then click table. Specify the required number of rows and columns and the table gets inserted. After adding the text to the document, save the document by clicking the file from the menu bar and click save .When we save the document for the first time name is to be entered and click save
Now the document has been created successfully.

EXERCISE 1: To create your class time table.

EXERCISE 2: Create a table having the following details: Student number, name and marks.Mark1 and Mark2 are the two columns that should be in the marks column.

RESULTS: Thus the above experiments are successfully done using Microsoft Word and output is verified.

Ex.No: Date:

CREATE A MERGED DOCUMENT

AIM: TO create a merged document using Microsoft word. PROCEDURE:


To enter Microsoft word, Click start button then click program from

programs menu then click Microsoft word Click Tools from the menu and choose Letters and mailings, then click mail merge from it. Then proceed with the following six steps to create a merged document. 1. From the list of document types available choose letters 2. Select current document as the starting document 3. Then select the recipients from the list. If the list is already available choose Use an existing list otherwise choose Type a new list and type the names & addresses of recipients 4. Write the content of the letter. To add recipient information to the letter, click a location in the document and then click Address block 5. One of the merged letter will be previewed and to preview another letter click one of the following: <<Recipient: 1>> 6. On clicking complete the mail merge mail merge is ready to produce the letters
Now the document has been created successfully.

EXERCISE 1: Using mail merge send the following letter to 5 of your friends.

RESULTS: Thus the above experiments are successfully done using Microsoft Word and output is verified.

Ex.No:

FLOWCHART
Date:

AIM: TO create a flowchart using Microsoft word. PROCEDURE:


To enter Microsoft word, Click start button then click program from

programs menu then click Microsoft word For opening a word document do the following. Click file menu from the menu bar. From this file menu click new option. This will display the new document. Enter the heading, change the font size. Click the B button on the formatting tool bar so that the heading appears bold.
To change the font color click A button on the drawing tool bar and select the

required colors. Click Autoshapes option from the drawing tool bar, then click flowchart and all the shapes will appear on the screen. Select the needed shapes one by one and place it on the screen. To connect all the boxes use flow lines from the drawing tool bar. To add text inside the shape, select the particular shape and right click the mouse button. Then a menu appears on the screen, select add text from the menu. Now the cursor appears inside the shape and allows us to enter the text.
Now the flowchart has been created successfully.

Exercise 1: Draw a flowchart to calculate the simple interest.

Start

Read the input values p, n, r.

Calculate Si=(p*n*r)/100

Print the Start Si Results Read the input value of n. End

f= fact(n);

Print the Results f

End int fact(int n) if(x== 1) return(x) Exercise 2: Draw a flowchart to find the factorial of a given number using function. x=x*fact(x-1); return(x)

RESULTS: Thus the above experiments are successfully done using Microsoft Word and output is verified.

MICROSOFT EXCEL

MS-EXCEL

An electronic spreadsheet or spreadsheet is a table of rows and columns into which data is entered. Spreadsheet software makes it possible to enter data into a task format, manipulate, store, print and create reports and graphics using them. Microsoft Excel is the most widely used and versatile spreadsheet package and lets you to organize your data into lists and then summarize, compare and present the data graphically. It has the user interface features common to other Microsoft office applications. MS-EXCEL allows you to Enter and edit data in a worksheet Use functions and formulae to calculate and analyze data Create colorful charts and graphs Save time by combining a series of commands into a single command by using MACROS

Ex.No:

CHART CREATION
Date:

AIM: TO create a chart for the given data. PROCEDURE:


To enter Microsoft Excel, Click start button then click program from

programs menu then click Microsoft Excel


For opening a word document do the following. Click file menu from the

menu bar. From this file menu click new option. This will display the new work sheet. Enter the data by placing the mouse pointer in a cell and a double click on it. Use the tab key to switch from one cell to another.
To insert charts select the data to which the chart should be created. Now click

insert chart icon. A window will appear and select the appropriate chart from it. Click next and enter the title, category(x) axis, category(y) axis etc. Click finish button. Then the appropriate chart is placed in the worksheet.

EXERCISE 1: Compare the population (in the year 2009 and 2001) in the main cities in India using various charts.

RESULTS: Thus the above experiments are successfully done using Microsoft Excel and output is verified.

Ex.No:

FORMULA EDITOR
Date:

AIM: To calculate HRA, DA, TA, PF, GPF, LIC, Gross salary, Deductions, Net salary from the given data in a worksheet.
ENO Name Basic HRA TA DA LIC PF GPF GS DED NET

1 2 3

MANIKANDAN.R 2000 Asd Bfr 0 1500 0 1000 0 7820 4569

4 Cde 5 Erg Where HRA is 18% of basic DA is 15% of basic TA is 12% of basic PF is 10% of basic GPF is 5% of basic LIC is 7% of basic

GS (Gross salary) =Basis+HRA+DA+TA DED (Deduction) =PF+GPF+LIC NET (Net salary) =GS-DED

PROCEDURE:
To enter Microsoft Excel, Click start button then click program from

programs menu then click Microsoft Excel


For opening a word document do the following. Click file menu from the

menu bar. From this file menu click new option. This will display the new work sheet. Enter the data by placing the mouse pointer in a cell and a double click on it. Use the tab key to switch from one cell to another. For putting formulas, for e.g., place the cursor on a cell which you have to calculate the value of HRA, then type =cell position of basic*18% and press enter. Now the value of HRA is calculated. Similarly do for all others. Calculate the same for other columns and drag them to all the cells. Now the entire table is ready in spreadsheet.

SCREEN SHOTS:

RESULTS: Thus the above experiments are successfully done using Microsoft Excel and output is verified.

Ex.No: Date:

SPREAD SHEET-INCLUSION OF OBJECT, PICTURE & GRAPHICS, PROTECTING THE DOCUMENT

AIM: i. ii. iii. Insert object in the worksheet Insert picture in the worksheet Protect a sheet

PROCEDURE:
To enter Microsoft Excel, Click start button then click program from

programs menu then click Microsoft Excel


For opening a word document do the following. Click file menu from the

menu bar. From this file menu click new option. This will display the new work sheet. For inserting object in the worksheet, choose objects option in the insert menu For inserting picture in the worksheet, choose Picture option in the insert menu
For protecting your worksheet, choose Protection option from Tools menu,

then chooses Protect Sheet option, Protect sheet dialog box appears. Type a password and press enter. Now your worksheet is protected and can be entered only with the password.

SCREEN SHOTS:

RESULTS: Thus the above experiments are successfully done using Microsoft Excel and output is verified.

Ex.No:

SORTING AND IMPORT/EXPORT FEATURES


Date:

AIM: i. ii. Sort the given data in the worksheet Include Import/export features

PROCEDURE:
To enter Microsoft Excel, Click start button then click program from

programs menu then click Microsoft Excel


For opening a word document do the following. Click file menu from the

menu bar. From this file menu click new option. This will display the new work sheet. Select the data to be sorted and select data from the menu and click sort

Specify the order in which the data are to be sorted (ascending or descending) and click OK. Then the sorted data appears in the sheet. To import a file select Insert->object->create from file To export a file while saving the file save it as webpage so that it can be viewed by internet explorer

EXERCISE 1: Sort the given data in ascending and descending order (consider the name).

S.N O
1 2 3 4 5 6 7 8 9 10 11 12

NAME

C P

ENG

MATH

CHE

PHY

EG TOT AVG

BARATHVAJ.V DINAKARAN.S GANESG.H HARIPRIYA.S PRIYANK.R RAJAMANI.A SARAVANAN.K VIVEK.S YAMINIDEVI.P POORANIYA.P RATHA.D KARUNAKARAN.K

96 80 78 96 80 78 96 80 78 96 80 78

85 59 89 85 59 89 85 59 89 85 59 89

45 85 45 45 85 45 45 85 45 45 85 45

85 59 89 85 59 89 85 59 89 85 59 89

45 85 45 45 85 45 45 85 45 45 85 45

50 85 45 45 85 45 45 85 45 45 85 45

406 453 391 401 453 391 401 453 391 401 453 391

67.67 75.50 65.17 66.83 75.50 65.17 66.83 75.50 65.17 66.83 75.50 65.17

EXERCISE 2: Sort the list of 10 students according to their average where Average=M1+M2+M3+M4+M5

RESULTS: Thus the above experiments are successfully done using Microsoft Excel and output is verified.

Ex.No: Date:

PROGRAM: /* Program to sort the array elements in descending order */


#include<stdio.h> #include<conio.h> void main() { int n; unsigned int arr[25],temp,i,j; clrscr(); printf("\nEnter the array size"); scanf("%d",&n); printf("\n\t Enter The Values into ARRAY "); for(i=1;i<=n;i++) { printf("\n\n Enter Element no %u: ",i); scanf("%u",&arr[i]); } for(i=1;i<=n-1;i++) { for(j=i+1;j<=n;j++) { if(arr[i]>arr[j]) {}

else { temp=arr[i]; arr[i]=arr[j]; arr[j]=temp; } } } printf("\n\n-- Sorted Series --"); for(i=1;i<=n;i++) { printf("\n \n \t %u",arr[i]); } getche(); }

SAMPLE INPUT/OUTPUT: Enter the array size 5 Enter the values into ARRAY Enter Element no 1: 8 Enter Element no 2: 9 Enter Element no 3: 5 Enter Element no 4: 7 Enter Element no 5: 6 -- Sorted series-9 8 7 6

Ex.No: Date:

PROGRAM: /* Program to generate the series of Armstrong number*/ #include<stdio.h> #include<conio.h> void main() { int n,m,i,t,s,r; clrscr(); printf("Enter the Limit :"); scanf("%d",&n); for(i=0;i<n;i++) { t=i;m=i; s=0; do { r=m%10; s=s+(r*r*r); m=m/10; }while(m>0); if(t==s) printf("\n%d\t Is an Armstrong Number",t); }

getch(); }

SAMPLE INPUT/OUTPUT: Enter the Limit :200 0 1 153 Is an Armstrong Number Is an Armstrong Number Is an Armstrong Number

Ex.No: Date:

PROGRAM: /* Program to Check the Given number is Prime Number or Not*/ #include<stdio.h> #include<conio.h> void main() { int a,c=0,i,n; printf("Enter the Number to be Checked :"); scanf("%d",&n); for(i=1;i<=n;i++) { a=n%i; if(a==0) { c=c+1; } } if (c==2) { printf("\nThe given Number is Prime"); } else printf("The given Number is not Prime"); getch();

SAMPLE INPUT / OUTPUT: Enter the Number to be Checked : 11 The given Number is Prime

Ex.No: Date:

PROGRAM: /* Program for Matrix Addition*/ #include<stdio.h> int a[30][30]; int b[30][30]; int c[30][30]; int i,j,k,m,n,p,q; void main() { clrscr(); printf("enter the order of matrix a:"); scanf("%d%d",&m,&n); printf("enter the order of matrix b:"); scanf("%d%d",&p,&q); printf("\n Enter The Elements of Matrix"); for(i=1;i<=m;i++) for(j=1;j<=n;j++) { printf("A(%d,%d)= ",i,j); scanf("%d",&a[i][j]); }

printf("\n"); for(i=1;i<=p;i++) for(j=1;j<=q;j++) { printf("B(%d,%d)= ",i,j); scanf("%d",&b[i][j]); } for(i=1;i<=m;i++) { for(j=1;j<=q;j++) { c[i][j]=b[i][j]+a[i][j]; } }

printf("\n The Addition of Two Matrix is\n "); for(i=1;i<=m;i++) { for(j=1;j<=q;j++) printf("%d\t",c[i][j]); printf("\n"); } getch(); }

SAMPLE INPUT / OUTPUT: enter the order of matrix a: 3 3 enter the order of matrix b: 3 3 Enter The Elements of MatrixA(1,1)=1 A(1,2)=2 A(1,3)=3 A(2,1)=4 A(2,2)=5 A(2,3)=6 A(3,1)=7 A(3,2)=8 A(3,3)=9 B(1,1)=1 B(1,2)=0 B(1,3)=1 B(2,1)=1 B(2,2)=0 B(2,3)=1

B(3,1)=1 B(3,2)=0 B(3,3)=1 The Addition of Two matrix is 2 5 8 2 5 8 4 7 10

Ex.No: Date:

PROGRAM: /* Program for find the area and circumference of circle */ #include <stdio.h> int main(void) { float radius, area, circum; printf("Enter radius: "); scanf("%f", &radius); area = radius * radius * 22 / 7; /* pr */ circum = 2 * radius * 22 / 7; /* 2pr */ printf("Area = %f\nCircumference = %f\n", area, circum); return 0; }

SAMPLE INPUT/OUTPUT: Enter radius :5 Area = 78.571426 Circumference = 31.428572

Ex.No: Date:

PROGRAM: /* Program for swapping two values */ include<conio.h> main() { int a,b; clrscr(); printf("enter the value for a & b\n"); scanf("d",&a,&b); printf("value of a is %d & b is %d before swapping\n",a,b); a=a+b; b=a-b; a=a-b; printf("value of a is %d & b is %d after swapping\n",a,b); getch(); }

SAMPLE INPUT /OUTPUT: Enter the value for a & b 5 6 value of a is 5 & b is 6 before swapping value of a is 6 & b is 5 after swapping

Ex.No: Date:

PROGRAM: /* Program for fid area of Triangle */ #include<stdio.h> #include<conio.h> #include<math.h> void main() { int a,b,c,s,area; clrscr(); printf("enter the values of the sides of the triangle\n"); scanf("%d%d%d",&a,&b,&c); s=(a+b+c)/2; area=sqrt(s*(s-a)*(s-b)*(s-c)); printf("the area of the triangle is %d",area); getch(); }

SAMPLE INPUT / OUTPUT: Enter the values of the sides of the triangle 5 4 5 The area of the triangle is 9

Ex.No: Date:

PROGRAM: /* Program for solve the quadratic equations 8/ #include<math.h> void main() { int a,b,c,d,e,f,g; clrscr(); printf("\nEnter the three values"); scanf("%d%d%d",&a,&b,&c); d=((b*b)-(4*a*c)); if(d==0) { printf("\nRoots are real and equal"); f=-b/(2*a); printf("x1=%d\nx2=%d",f,f); } else if(d>0) { printf("\nRoots are real and distinct"); e=sqrt(d); f=(-b+e)/(2*a);

g=(-b-e)/(2*a); printf("\nx1=%d\nx2=%d",f,g); } else { printf("\nRoots are imaginary\n"); d=-d; e=sqrt(d); f=-b/(2*a); g=e/(2*a); printf("\n\tx1=%d+%d\n\tx2=%d-i%d",f,g,f,g); } getch(); }

SAMPLE INPUT / OUTPUT: Enter the three values 4 5 6 Roots are imaginary x1=0+1 x2=0-i1

Ex.No: Date:

PROGRAM: /* Program for find biggest among three numbers */ #include<stdio.h> void main() { int a,b,c,big; clrscr(); printf("\nEnter 3 numbers:"); scanf("%d %d %d",&a,&b,&c); big=(a>b&&a>c?a:b>c?b:c); printf("\nThe biggest number is:%d",big); getch(); }

SAMPLE INPUT / OUTPUT: Enter 3 numbers:8 9 2 The biggest number is :9

Ex.No: Date:

PROGRAM: /* Program for find the factorial of given number using loop*/ #include<stdio.h> #include<conio.h> void main() { int n,f; f=1; clrscr(); printf("Enter the number:\n"); scanf("%d",&n); while(n>0) { // printf("%d",n); f=f*n; n--; } printf("\nThe factorial of the integer is:%d",f); getch(); }

SAMPLE INPUT / OUTPUT: Enter the number: 5 The factorial of the integer is : 120

Ex.No: Date:

PROGRAM: /* Program for find Fibonacci series */ #include<stdio.h> int main() { unsigned int i=0,j=0,sum=1,num; clrscr(); printf("\nEnter the limit for the series "); scanf("%d",&num); printf("%d ",i); while(sum<num) { printf("%d ",sum); i=j; j=sum; sum=i+j; } getch(); return 0; }

SAMPLE INPUT / OUTPUT: Enter the limit for the series 25 0 1 1 2 3 5 8 13 21

Ex.No: Date:

PROGRAM: /* Program for check the given number is palindrome or not */ #include <stdio.h> int main() { int n,temp,r,sum=0; printf("\n\nEnter no: "); scanf("%d",&n); temp = n; while(n>0) { r=n%10; n/=10; sum=sum*10 + r; } if (sum==temp) printf ("\nThe Number Is A Palindrome "); else printf ("\nThe Number Is Not A Palindrome "); getch (); return 0;

SAMPLE INPUT / OUTPUT: Enter no: 232 The Number is a Palindrome

Ex.No: Date:

PROGRAM: /*To check whether a string is palindrome/not without using string header file*/ #include <stdio.h> #include <stdlib.h> int main () { int i,j; char a[10]; clrscr (); printf("\n Enter the Strings :"); gets(a); for (i=0;a[i]!='\0';i++) { } i--; for (j=0;a[j]!='\0';j++,i--) { if (a[i]!=a[j]) { printf("\nString is not Palindrome"); return(0); }

} printf("\nString is Palindrome"); getch(); return(0); }

SAMPLE INPUT / OUTPUT: Enter the Strings : madam String is Palindrome

Ex.No: Date:

PROGRAM: /* Student Information Using Structure */ #include<stdio.h> #include<conio.h> void main() { struct student { int hno; char name[20]; int rno,cp,ph,ch,eng,eg,ma,tot; float avg; } s[10],t; int n,i,j; clrscr(); printf("\n How many students' data do you want to print;"); scanf("%d",&n); printf("\NENTRIES OF STUDENT' DATA"); printf("\n----------------------------------------------"); for(i=0;i<n;i++) {

printf("\n\n Enter the Roll Number :"); scanf("%d",&s[i].rno); printf("\n\n Enter the Name of Student:"); scanf("%s",s[i].name); printf("\n\n Enter the CP Mark :"); scanf("%d",&s[i].cp); printf("\n\n Enter the Physics Mark :"); scanf("%d",&s[i].ph); printf("\n\n Enter the Chemistry Mark :"); scanf("%d",&s[i].ch); printf("\n\n Enter the English Mark :"); scanf("%d",&s[i].eng); printf("\n\n Enter the EG Mark :"); scanf("%d",&s[i].eg); printf("\n\n Enter the Maths Mark :"); scanf("%d",&s[i].ma); s[i].tot=s[i].cp+s[i].ph+s[i].ch+s[i].eng+s[i].eg+s[i].ma; s[i].avg=s[i].tot/6; } clrscr(); printf("\n\t RESULT OF STUDENTS"); printf("\n\n\t========================================"); for(i=0;i<n;i++) { printf("\n\n\t NAME : %s",s[i].name); printf("\tRoll No : %d",s[i].rno); printf("\n\n\t ======================================"); printf("\n\n\t F computing & Programming =%d",s[i].cp); printf("\n\n\t Engineering Physics =%d",s[i].ph); printf("\n\n\t Engineering Chemistry =%d",s[i].ch); printf("\n\n\t English I =%d",s[i].eng); printf("\n\n\t Engineering Graphics =%d",s[i].eg); printf("\n\n\t Mathematics I =%d",s[i].ma); printf("\n\n\t ======================================"); printf("\n\n\t Total Marks =%d",s[i].tot); printf("\n\n\t Average Marks =%0.2f",s[i].avg); printf("\n\n\t ======================================"); if(s[i].avg>=90) { printf("\n\n\t GRADE -A FIRST CLASS ");

} else if((s[i].avg>60)&(s[i].avg<90)) { printf("\n\n\t GRADE -B SECOND CLASS "); } else { printf("\n\n\t GRADE -C THIRD CLASS"); } printf("\n\n\t========================================" ); } getch(); } SAMPLE INPUT / OUTPUT: How many students data you want to print ENTRIES OF STUDENT DATA ---------------------------------------------------------------------------Enter the roll Number :101 Enter the Name of the Student :Manikandan.R Enter the CP Mark :99 Enter the Physics Mark :80 Enter the Chemistry Mark :90 Enter the English Mark :87 Enter the EG Mark :99 Enter the Maths Mark :69 Enter the roll Number Enter the Name of the Student Enter the CP Mark Enter the Physics Mark Enter the Chemistry Mark Enter the English Mark Enter the EG Mark Enter the Maths Mark :102 :BarathiRaja.R :99 :80 :90 :87 :99 :99

RESULT OF STUDENTS

============================================= NAME : Maniakandan.R Roll No : 101 ============================================= F computing & Programming =99 Engineering Physics =80 Engineering Chemistry =90 English I =87 Engineering Graphics =99 Mathematics -I =69 ============================================ Total Marks =524 Average Marks =87.00 ============================================ GRADE B SECOND CLASS ============================================ ============================================= NAME : BarathiRaja.R Roll No : 102 ============================================= F computing & Programming =99 Engineering Physics =80 Engineering Chemistry =90 English I =87 Engineering Graphics =99 Mathematics -I =99 ============================================ Total Marks =554 Average Marks =92.00 ============================================ GRADE A FIRST CLASS ============================================

Ex.No: Date:

PROGRAM: /* Employee details using Struct */ #include<stdio.h> #include<conio.h> void main() { struct employee { char name[20]; int bs,eno; float net,det,gro,hra,da,ta,lic,gpf,pf; } s[10],t; int n,i,j; clrscr(); printf("\n How many Employee's data do you want to print;"); scanf("%d",&n); printf("\n ENTRIES OF EMPLOYEE'S DATA"); printf("\n-------------------------------------------------------"); for(i=0;i<n;i++) {

printf("\n\n Enter the Employee ID :"); scanf("%d",&s[i].eno); printf("\n\n Enter the Name of Employee:"); scanf("%s",s[i].name); printf("\n\n Enter the Basic Salary :"); scanf("%d",&s[i].bs); s[i].hra=(s[i].bs)*18/100; s[i].da=(s[i].bs)*15/100; s[i].ta=(s[i].bs)*12/100; s[i].pf=(s[i].bs)*10/100; s[i].gpf=(s[i].bs)*5/100; s[i].lic=(s[i].bs)*7/100; s[i].gro=s[i].bs+s[i].hra+s[i].da+s[i].ta; s[i].det=s[i].pf+s[i].gpf+s[i].lic; s[i].net=(s[i].gro) - (s[i].det); } clrscr(); printf("\n\t EMPLOYEE DETAILS WITH PAY SLIP "); printf("\n\n\t========================================") ; for(i=0;i<n;i++) { printf("\n\n\t NAME : %s",s[i].name); printf("\tRoll EMP No : %d",s[i].eno); printf("\n\n\t ======================================"); printf("\n\n\t GROSS SALARY =%0.2f",s[i].gro); printf("\n\n\t DEDUCTION =%0.2f",s[i].det); printf("\n\n\t BASIC SALARY =%0.2d",s[i].bs); printf("\n\n\t ======================================"); printf("\n\n\t NET SALARY =%0.2f",s[i].net); printf("\n\n\t ======================================"); } getch(); }

SAMPLE INPUT / OUTPUT: How many Employee's data do you want to print;1 ENTRIES OF EMPLOYEE'S DATA --------------------------------------------------Enter the Employee ID Enter the Name of Employee Enter the Basic Salary :404 :Manikandan.R :8000

EMPLOYEE DETAILS WITH PAY SLIP ======================================== NAME : Manikandan.R EMP No :404 ======================================== GROSS SALARY =8323.00 DEDUCTION =-206.00 BASIC SALARY =8000 ========================================

NET SALARY =8529.00 ========================================

Ex.No: Date:

PROGRAM: /* Factorial Using Recursion */ #include<stdio.h> #include<conio.h> int fact(int); int f=1; void main() { int n; clrscr(); printf("\nEnter the Number :"); scanf("%d",&n); f=fact(n); printf("\n FACTORIAL OF %d IS=%d",n,f); getch(); } int fact(int k) {

if(k==1) { return 1; } else k=fact(k-1)*k; return k; }

SAMPLE INPUT / OUTPUT: Enter the Number :10 FACTORIAL OF 10 IS =24320

Ex.No: Date:

PROGRAM: /* Fibonacci Series Using Recursion */ #include<stdio.h> #include<conio.h> void fib(int,int,int); void main() { int n,f=-1,s=1; clrscr(); printf("\nEnter the Number of times to Print :"); scanf("%d",&n); printf("\n FIBONACCI SEQUENCE "); fib(n,f,s); getch(); } void fib(int n,int f,int s) { int no=0; if(n>0) { no=f+s; printf("\n\t%d",no);

fib(n-1,s,no); } }

SAMPLE INPUT / OUTPUT: Enter the Number of times to print: 10 FIBONACCI SEQUENCE 0 1 1 2 3 5 8 13 21 34