Вы находитесь на странице: 1из 44

VEL TECH HIGH TECH Dr. RANGARAJAN Dr.SAKUNTALA ENGINEERING COLLEGE (Owned by R.S.

Trust)
(Approved by AICTE, New Delhi & Affiliated to Anna University) No.60, Avadi Vel Tech Road, Chennai-600062.

BACHELOR OF COMPUTER SCIENCE AND ENGINEERING GE2115 Computer Practice Lab - I SEMESTER I

Prepared by CSE Dept.

Vel Tech High tech Dr Rangarajan Dr Sakunthala Engineering College (Owned by R.S Trust) COMPUTER PRACTICE-I LABORATORY
LIST OF EXERCISES

a) Word Processing
1. Document creation, Text manipulation with Scientific notations. 2. Table creation, Table formatting and Conversion. 3. Mail merge and Letter preparation. 4. Drawing - flow Chart

b) Spread Sheet
5. Chart - Line, XY, Bar and Pie. 6. Formula - formula editor. 7. Spread sheet - inclusion of object, Picture and graphics, protecting the Document and sheet. 8. Sorting and Import / Export features.

Simple C Programming
9. Data types, Expression Evaluation, Condition Statements. 10. Arrays 11. Structures and Unions 12. Functions

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

CREATING A WORD DOCUMENT


AIM: To create a Document, Text Manipulation with Scientific Notation in M.S 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 EXERCISE 1: Create a Document, Text Manipulation with Scientific Notation in M.S Word

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. Text Manipulation
God is great Prevention is better than cure

counterfeit currency.

Union is strength Scientific Notation (a+b)(a-b)=a2-b2 (a+b)2=a2+b2+2ab 2H2+O2->2H2O

CREATING A TABLE

AIM: To create a table, table format and table conversion 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: 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.

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.

From Anto, B-62,13th cross street, Rose apartments, Ambattur, Chennai. To

Dear, Sub: Invitation for party. I hereby invite you and your family members for the 25th anniversary of my parents that is to be held on 28-11-2008 at our home. Please do come and share with us our joy. I will be disappointed in your absence.

Yours lovingly, EXERCISE 2: A college wants to invite all the old students for its old students association to be held in the college. Prepare a mail merged letter, in which only the address changes for every student and the body of the letter remains unchanged.

FLOWCHART
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. Exercise 2: Draw a flowchart to find the factorial of a given number using function.

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 command by using MACROS

Save time by combining a series of commands into a single

CHART CREATION

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 2007 and 2008) in the main cities in India using various charts. EXERCISE 2: Using various Charts compare the performance of 3 students in their examination. Create Line, XY, Bar, Pie charts for the following data NAME MARK1 MARK2 MARK3 Anto 96 85 45 Ignatius 80 59 85 Griffin 78 89 45

FORMULA EDITOR
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

Abc Asd Bfr

2000 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 eg,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.

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 choose 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.

SORTING AND IMPORT/EXPORT FEATURES


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). NAME MARK1 MARK2 MARK3 Anto 96 85 45 Ignatius 80 59 85 Griffin 78 89 45 EXERCISE 2: Sort the list of 10 students according to their average where Average=M1+M2+M3+M4+M5

C PROGRAMMING

EX:NO:1 DATE :

SIMPLE AND COMPOUND INTEREST

Aim: To write a C program to find the Simple Interest and Compound Interest. Algorithm: Step1: Start the Program. Step2: Declare the data type and variable. Step3: evaluate the Simple Interest and Compound Interest. Step4: Exit the program. Program: #include<stdio.h> #include<conio.h> #include<math.h> void main() { int p,n,r; float si,ci; clrscr(); printf( Enter the value of P:\n); scanf(%d, &p); printf( Enter the value of N:\n); scanf(%d, &n); printf( Enter the value of R:\n); scanf(%d, &r); si = p*n*r/100; ci = si+p; printf(Simple Interest : %f, si); printf(Compound Interest : %f, ci); getch(); }

Input and Output: Enter the value of P: 4 Enter the value of P: 5 Enter the value of P: 6 Simple interest: 1.200000 Compound interest: 1016.0000

Result: Thus the Simple and Compound interest found successfully.

EX:NO:2 DATE : Aim:

SWAP USING TWO VARIABLES

To write a C program to perform swapping two variable without using temporary variable. Algorithm: Step 1: Read the two numbers a & b Step 2: Perform 2.1 a = a + b; 2.2 b = a - b; 2.3 a = a - b; Step 3: Print the numbers a and b Program: #include<stdio.h> #include<conio.h> Void main() { int a,b; Printf(enter the value for a,b); Scanf(%d%d,&a,&b); a = a + b; b = a - b; a = a - b; printf(The value of a=%d,a); printf(the value of b=%d,b); }

Input and Output: Enter the value of a and b: 56 75 The value of a =75 The value of b =56

Result: Thus the program has been executed successfully.

EX:NO:3 DATE :

QUADRATIC EQUATION

Aim: To find the given number is real or complex. Algorithm: Step1: Start the program. Step2: Declare the required variable. Step3: Cut the co-efficient of a,b,c from the user. Step4: Find the value of d using formula. Step5: If d>0 then print roots are real and not equal and find value of x1,x2. Step6: If d=0 then print roots are real and not equal and find value of x. Step7: Otherwise print roots are complex. Step8: Stop the program. Program: #include<stdio.h> #include<conio.h> #include<math.h> void main() { float a,b,c,d,x1,x2,x; clrscr(); printf(Enter the co-efficient of a,b,c\n); scanf(%f%f%f , &a,&b,&c); d= b*b - 4*a*c; if (d>0) { x1 = -b+sqrt(d)/2*a; x2 = -b-sqrt(d)/2*a; printf(Roots are real and not equal\n); printf(%f%f,x1,x2); } else if(d>0 )

{ x= -b/2 * a; printf(Roots are complex\n); printf(%f, x); } else printf(Roots are complex); getch(); }

Input and Output: Enter Co-efficient of a,b,c 9 8 6 Roots are real and not equal: -36.000000

Result: The program is executed and output is verified.

Ex. No: 4 Date : Aim:

PALINDROME OR NOT

To write a C program to find the given string is palindrome or not. Algorithm: STEP-1 :- Start. STEP-2 :- Read input,copy,condition,length,i. STEP-3 :- To find length of string use length=strlen(input). STEP-4 :- for(i=0;i<length;i++) and to change the string to upper case use input[i]=toupper(input[i]). STEP-5 :- To copy the string use strcpy(input,copy). STEP-6 :- Reverse the string by strrev(input). STEP-7 :- condition=strcmp(input,copy). STEP-8 :- if(condition= = 0) print the given input is palindrome, else print . the given string is not palindrome STEP-9 :- Stop. Program: #include<stdio.h> #include<conio.h> #include<string.h> #include<ctype.h> void main() { clrscr(); char input[50],copy[50]; int condition,length,i; printf("Enter the input :"); scanf("%s",input); length = strlen(input); for (i=0; i<length; i++) {

input[i] = toupper(input[i]); } strcpy(copy,input); strrev(input); condition = strcmp(input,copy); if(condition = = 0) printf("\nThe given input is palindrome"); else printf("\n The given input is not palindrome"); getch(); }

Input and Output: Enter the input:mam The given input is palindrome Enter the input:dog The given input is not palindrome

Result: Thus the C program has been executed successfully

Ex. No: 5 Date : Aim:

PRIME NUMBER OR NOT

To write a C program that prints the given number is prime or not. Algorithm: STEP-1 :- Start. STEP-2 :- Read num,temp=2,k. STEP-3 :- While(temp<=num/2), k= num%temp STEP-4 :- if k = 0 STEP-5:- Print Number is Composite STEP-6:- temp++ goto step 3 STEP-7:- Print Number is Prime STEP-8 :- Stop. Program: #include<stdio.h> #include<conio.h> #include<process.h> void main() { clrscr(); long int num, temp =2, k; printf("Enter the number: "); scanf("%ld",&num); while(temp<=num/2) { k = num%temp; if(k == 0) { printf("\n\n\n\t\t The Number Is Composite!!"); getch(); exit(0); } temp++; } printf("\n\n\n\t\tThe Number is Prime!!");

getch(); } Input and Output: Enter the number:7 The number is prime Enter the number:4 The number is composite

Result: Thus the C program has been executed successfully

Ex. No:6
INTEGERS

CALCULATE AND DISPLAY AVERAGE OF 10

Date: Aim: To write a program to calculate and display the average of 10 integer number using Algorithm:
1.

Declare the required variables

2. Perform the operation using for loop to calculate the total ,average of given ten number 3. Print the result 4. Terminate the program

Program: #include<stdio.h> #include<conio.h> Void Main() { Int a[10],s=0,avg=0,i ; Printf(enter the ten numbers:\n); For(i=0;i<10;i++) { Scanf(%d,&a[i]); } For(i=0;i<10;i++) { S=s+a[i]; } Avg=s/10; Printf(sum=%d\n,s); Printf(avg=%d\n,avg); Getch(); }

Input and Output: Enter the ten numbers: 21 12 12 45 78 8 56 36 45 54 Sum=367 Avg=36

Result: Thus the C program has been executed successfully Ex. No: 7 MATRIX ADDITION Date : Aim: To write a C program to implement matrix addition. Algorithm: Step1: Start the program. Step2: Declare the two Dimensional array to get the matrix from the user. Step3: Add the two matrices by using for loop. Step4: Print Resultant matrix using print function. Step5: Stop the program. Program: #include<stdio.h> #include<conio.h> void main() { int m,n,o,p,i,j,k,a[20][20],b[20][20],c[20][20]; printf(Enter the row & column order first and second matrix\n); scanf(%d%d%d%d, &m,&n,&o,&p); printf(Enter a matrix values\n); for(i=1;i<=m;i++) for(j=1;j<=n;j++) scanf(%d , &a[i][j]); printf(Enter b matrix values\n); for(i=1;i<=o;i++) for(j=1;j<=p;j++) scanf(%d , &b[i][j]); for(i=1;i<=m;i++) for(j=1;j<=p;j++) c[i][j] =a[j][j]+b[i][j]; printf(The Resultant Matrix is:\n\n); for(i=1;i<=m;i++) { for(j=1;j<=p;j++) printf(\t%d , c[i][j]); printf(\n);

getch(); } } Input and Output: Enter the row &column order first and second matrix 2 2 2 2 Enter a matrix values 43 65 76 43 Enter b matrix values 23 45 67 87 The resultant matrix is 66 110 143 130

Result: Thus the C program has been executed successfully

Ex. No: 8 Date : Aim:

STUDENT DETAILS

To write a C program to use structures to print name and address of student. Algorithm:STEP-1 :- Start. STEP-2 :- Read Structure addr,student. STEP-3 :- Read structure members name,doorno,strtname,place,city STEP-4 :- Print structure members name,doorno,strtname,place,city STEP-5 :- Stop. Program:#include<stdio.h> #include<conio.h> struct addr{ int doorno[10]; char strtname[15]; char place[20]; char city[20]; }; struct student{ char name[15]; struct addr address; }s1; void main() { clrscr(); printf("\n\t\t Enter Student Name: "); gets(s1.name); printf("\n\t Enter Address: \n"); printf("\n\t\t Enter Door number : "); gets(s1.address.doorno);

printf("\n\t\t Enter Street name : "); gets(s1.address.strtname); printf("\n\t\t Enter Place : "); gets(s1.address.place); printf("\n\t\t Enter City : "); gets(s1.address.city); printf("\n\n\n\t\t Student Name: "); puts(s1.name); printf("\n\t Address: \n"); printf("\n\t\t Door number : "); puts(s1.address.doorno); printf("\n\t\t Street name : "); puts(s1.address.strtname); printf("\n\t\t Place : "); puts(s1.address.place); printf("\n\t\t City : "); puts(s1.address.city); getch(); } Input and Output:

Result: Thus the C program has been executed successfully Ex. No: 9 TABULATE THE SURVEY DATA DATE : Aim: To write a C program for tabulate the survey data. Algorithm: Step1: Start the program. Step2: Declare the required variable and defined the structured name as people with Data members voter ID, age , date , month , year. Step3: Get the input for people details using structure variable as one by one. Step4: Print the information of people one by one using for loop. Step5: Find the total number of males and females and print the details. Step6: Stop the program. Program: #include<stdio.h> #include<conio.h> void main() { int i,n,p1=0,q=0; struct people { int id; int age; char sex; char date; int mm; int yy; } p[50]; clrscr(); printf(People surve 2009\n\n); printf(Enter no.of people to survey\n); scanf(%d, &n);

for(i=0;i<n;i++) { printf(Enter voter id numbers , age\n); scanf(%d%d, &p[i].id ,&p[i].age); printf(Enter dd mm yy of dob\n); scanf(%d%d%d , &p[i].date ,&p[i].mm ,&p[i].yy); printf(Enter sex(M/F)\n); scanf(%s, ,&p[i].sex); } printf(The survey Details\n); printf(Total number of persons%d\n,n); printf(The survey Details\n); printf(-----------------------\n); printf(Voter id age dob sex\n); for(i=0;i<n;i++) { if(p[i].sex==m) { p1++; } if(p[i].sex==f) { q++; } } for(i=0;i<n;i++) { printf(%d%d%d-%d-%d%c\n\n, &p[i].id ,&p[i].age &p[i].date ,&p[i].mm ,&p[i].yy, &p[i].sex); } printf(The total number of males are %d\n\n,p1); printf(The total number of females are %d\n\n,q); getch(); }

Input and Output: People survey 2009 Enter no of people to survey: 2 Enter voter id number , age: 1234 22 Enter dd mm yy of dob: 12 89 30 Enter sex(M/F): M Enter voter id number , age: 1242 21 Enter dd mm yy of dob: 10 79 02 Enter sex(M/F): f

The survey Details Total number of persons: 2 Voter id age dob sex: 1234 22 12 89 30 1242 21 10 79 02 Total number of males :1 Total number of females:1

Result:

Thus the C program was successfully executed and output is verified. Ex. No: 10 DATE : FACTORIAL USING RECURSIVE FUNCTION Aim: To write a recursive function to find the factorial of a given number. Algorithm: 1.Declare and define the recursive function 2.Declare the required variablesin main() 3.Get the numbers to find factorial . 4.Call the factorial function from main() with the number to find factorial as the argument 5.The factorial function calls itself again and again to calculate factorialvalue ,until the argument value becomes 0 6.when the argument zero,it return to main() and the factorial value is printed Program: #include<stdio.h> #include<conio.h> Llong int fact(long int); Main()

Long int num,fval; Clrscr(): Printf(type a number :): Scanf(%d,&num); Fval=fact(num); Printf(\n factorial of %d is %d ,num ,favl :); Getch(); } Long int fact(long int num) { Long int f; If(num==0) Return(1); Else F=num*fact(num-1); Return f; }

Input and Output: Type a number :7 Factorial of 5 is 5040 Result: Thus the program to find the factorial is executed.

Result: Thus the C program was successfully executed and output is verified.

Ex. No: 11 DATE : SWAPPING TWO VARIABLES USING POINTERS

Aim: To write a C program for swaping the contents of two variables using pointers as function arguments. Algorithm: Step1: Start the program. Step2: Declare the required variables for swaping the variable. Step3: Set the input from the user using scanf function. Step4: Defined a function with arguments to pass a address of variables to the called Function. Step5: Swap the two contents of variable using temp variable. Step6: Print the contents of variable after exchange the values. Step7: Stop the program. Program: #include<stdio.h> #include<conio.h> void main() { int a,b; printf(Enter the two number for exchange\n); scanf(%d%d , &a,&b); exchange(&a,&b); printf(The content after exchange %d\t%d\n,a,b); } exchange(a,b) int *a,*b; { int temp; temp=*a; *a=*b; *b=temp; }

Input and Output:

Enter the two number for exchange 25 89 The content after exchange 89 25

Result: Thus the C program was successfully executed and output is verified.

Вам также может понравиться