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

Ex.No: 1.

1 Document creation and Text Manipulation


Date :

Aim:

Create the document containing the text given below, and perform the following tasks:

A Flowchart is a diagrammatic representtion of instructons to perform a particular


task.
A program is a set of instructons, which are executed by a computer, in order to
perform specific tasks.
There are so many computer languages such as BASIC, COBOL, FORTRAN,
PASCAL, C, C++.

(i) Justify the text.


(ii) The words such as BASIC, COBOL, FORTRAN, PASCAL, C, C++ must be in
bold size.
(iii) Correct the spellings such as representtion, instructons.
(iv) Show the words Flowchart, Program in Italic style and Underline them.
(v) Save the document under a suitable name.

Procedure:

1.Open a new document using File -> New option and type text. For Justification
select the entire text in the document. Then press CTRL+J or select the Justify
button on the formatting tool bar.
2.Select the word you want to change into bold face. Then press CTRL+B or select the
Bold button on the formatting tool bar.
3.For Spelling corrections, select the word you want to correct, then right click the
mouse or click Spelling and Grammar button on the standard tool bar.
4.Select the word which you want to make Italic style then press CTRL+I or select the
Italic button on the formatting tool bar. For Underline press CTRL+U or select the
Underline button on the formatting tool bar.
5.For saving the document, press CTRL+S or click on Save button on Standard tool
bar or select the Save option from the File menu. Then it shows the Save As dialog
box. Choose a suitable file name in File Name text box, then click Save button on
Save As dialog box.
Output:

A Flowchart is a diagrammatic representation of instructions to perform a particular


task.
A program is a set of instructions, which are executed by a computer, in order to
perform specific tasks.
There are so many computer languages such as BASIC, COBOL, FORTRAN,
PASCAL, C, C++.

Result:
Thus the document created using MS – WORD and Text manipulation done
successfully.
Ex.No: 1.2 Table Creation and Table formatting
Date :

Aim:
Creating Table with sample data and formatting table using Table Properties.
Procedure:

1. Choose Table -> Insert -> Table option.


2. It shows the Insert Table dialog box.
3. Then choose the required number of columns and rows.
4. Then click OK to add table in your document
5. Then type the text in each column
Output:

Book Name Author


V. Ramesh Babu
Computer Practice-I
Y. Samyuktha
V. Ramesh Babu
Computer Practice-II
M. Muni Rathnam
Engineering Mechanics V. Ramesh Babu
Engineering Drawing V. Ramesh Babu

Result:
Thus the document created using MS – WORD and Text manipulation done
successfully.
Ex.No: 1.3 Mail Merge for sending Resume
Date :

Aim:
To create a Mail Merge for sending the Bio – Data.

Procedure:

1. Select Tools -> Letters and Mailing -> MailMerge Wizard.


2. Select letters then click on starting document
3. Choose use the current document then click on select recipient
4. Choose Type a new list, click on create, a New Address list dialog box will be
display
5. Type the required details then click close
6. Save address list dialog box will be display, type filename and save it
7. Mail Merge Recipient dialog box will be display, click ok.
8. Click on write your letter
9. Write the bio-data in the document , place the cursor on To place then click on
address block
10. Insert Address block dialog box will be display, select any type then click ok
11. Click on preview your letter
12. Select the recipient then click on complete the merge
13. Click on Edit individual letter, Merger to new document dialog box will be display
then select current record and click ok
14. Finally Merged document will be create
Output:

From
Xxxx,
Maamallan Nagar,
Vadamangalam,
Chennai.

To

Ramesh babu
tcs
73,S.N Chetty st
Chennai - 6000081
TamilNadu

Bio – Data

Name : XXXX

D.O.B : 23-jul-1988

Address : Maamallan Nagar,


Vadamangalam,
Chennai.

State : TamilNadu

Country : India

Result:
Thus the document created using MS – WORD and Mail – Merge is done successfully.

Ex.No: 1.4 Draw a flowchart to calculate the simple interest


Date :

Aim:
Draw a flowchart for calculating simple interest.
Procedure:

1. Find out the formula and necessary calculation.


2. Select Insert -> shape -> Flowchart option.
3. Choose the required flowchart symbol for Start.
4. Choose the required flowchart symbol for Read.
5. Choose the required flowchart symbol for Calculation.
6. Choose the required flowchart symbol for Write.
7. Choose the required flowchart symbol for Stop.

Output:
START

READ P, N, R

SI = P*N*R/100

WRITE SI

STOP

Result:
Thus the document created using MS – WORD and flow chart is sketched successfully.
Ex.No: 2.1 Creating chart using MS - Excel
Date :

Aim:
Creating different type of Chart based on the sample data using MS –Excel.
The ABC Company the sales of different products for 5 years. Create Line, XY, Bar
and Pie chart for the following.

Procedure:
1. Type the data as shown in the worksheet.
2. Click at cell address A1, click Insert -> Chart.
3. Excel will display the first dialog box of Chart Wizard.
4. Select Graph type and click on Next.
5. Click on Data Range from the Chart Wizard dialog box.
6. Select A1 to E6, then click Next.
7. Click in the chart title box, type ABC – COMPANY.
8. Click on the Category X-Axis, type YEAR
9. Click on the Value Y-Axis type PRODUCT
10. Click Next, then click FINISH
11. Excel will display the created chart in the current worksheet.
Output:
ABC- COMPANY

100%

PRODUCT
80% Series5
Series4
60%
Series3
40%
Series2
20% Series1
0%
1 2 3 4 5
YEAR

ABC - COMPANY

1200
PRODUCT

1000
Series1
800
Series2
600
Series3
400
Series4
200
0
1998 2000 2002 2004 2006
YEAR

ABC- COMPANY

5
PRODUCT

Series1
4 Series2
3 Series3
2 Series4
Series5
1

0 2000 4000 6000


YEAR
ABC - COMPANY

1
2
3
4
5

Ex.No: 2.2 MS-Excel - Using formula Bar


Date :

Aim:
Calculate HRA, DA, TA, PF, LIC, Gross Salary, Deductions, Net salary from given
data in a worksheet.

ENO Name Basic HRA TA DA LIC PF GPF GS DED NET


1 Abc 20000
2 Asd 15000
3 Bfr 10000
4 Cde 7820
5 Erg 4569

Where
HRA is 18% of BASIC
DA is 15% of BASIC
TA is 12% of BASIC
PF is 10% of BASIC
LIC is 7% of BASIC
GS (Gross Salary) = BASIC + HRA + DA + TA
DED (Deductions) = PF + LIC
NS (Net Salary) = GS – DED

Procedure:
1. For HRA put the cell pointer in D3 and press = (equal to) for entering the
formula. Then choose the C3 cell (Basic Salary) and type * (multiplication
operator) and type 18% then press enter.
2. Then drag that formula for entire records.
3. For TA put the cell pointer in E3 and press = (equal to) for entering the
formula. Then choose the C3 cell (Basic Salary) and type * (multiplication
operator) and type 15% then press enter.
4. Then drag that formula for entire records.
5. Follow the above steps for calculation of DA, PF, LIC.
6. For GS (Gross Salary) put the cell pointer in I3 and choose the = , then click on C3
cell + click on D3 + click on E3 + click on F3 and press enter.
7. Drag all the cell
8. Follow the above step for DED and NS calculation.
Output:
Result:
Thus the excel sheet created using MS – EXCEL formula bar, the HRA and DA
calculated Successfully.
Ex.No: 2.3 MS-Excel - Inserting Object in MS-Excel
Date :

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

Procedure:
1. To enter Microsoft Excel, Click “start” button then click “program” from “programs”
menu then click “Microsoft Excel”
2. 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.
3. For inserting object in the worksheet, choose objects option in the insert menu
4. For inserting picture in the worksheet, choose Picture option in the insert menu
5. 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.
6. Now your worksheet is protected and can be entered only with the password.
Output:
Result:
Thus the excel sheet created using MS – EXCEL , the object and picture inserted
Successfully.

Ex.No: 3 Write a simple C program for menu driven calculator using switch statement
Date :

Aim:
To write a menu driven program to find
1. Factorial of the given number
2. Prime number or not
3. Even number or Odd number
4. Exit

Algorithm:

Step-1 Start the program


Step-2 Enter the number
Step-3 Enter your choice using switch statement
Step-4 If you choose the choice 1. Find the factorial
Step-5 set a loop up to the entered number
Step-6 Calculate factorial fact=fact*I
Step-7 Print the factorial value
Step-8 If you choose the choice 2.Find whether the number is prime or not
Step-9 set a loop up to number-1
Step-10 Check the number is divide by any number other than one
and the number itself
Step-11 If divide absolutely then print the number is not a prime
Step-12 If not divide other than one and itself then print the number is prime
Step-13 If you choose the choice 3. Find whether the number is odd or even
Step-14 If the number is divide by 2 then print the number is even
Step-15 If the number is not dividing by 2 then print the number is odd
Step-16 If you choose the choice 4.Exit the program
Step-17 Continue the program
Program: 3

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,n;
clrscr();
printf("--MENU--");
printf("\n1.Addition\n2.Subtraction\n3.Multiply\n4.Division\n0.Exit");
printf("\nEnter your choice:");
scanf("%d",&n);
if(n<=4&n>0)
{
printf("\nEnter two numbers:");
scanf("%d%d",&a,&b);
}
switch(n)
{
case 1:
c=a+b;
printf("Addition :%d",c);
break;
case 2:
c=a-b;
printf("Subtraction :%d",c);
break;
case 3:
c=a*b;
printf("Multiplication :%d",c);
break;
case 4:
c=a/b;
printf("Division :%d",c);
break;
case 0:
exit(0);
break;
default:
printf("Invalid choice");
}
getch();
}

Output:

--MENU--
1.Addition
2.Subtraction
3.Multiply
4.Division
0.Exit
Enter your choice:3

Enter two numbers:4 5


Multiplication :20
Ex.No: 4 Write a simple C program for finding whether the number is Prime or Not
Date :

Aim:
To write a program to find whether the number is prime or not.

Algorithm:

Step-1 Start the program


Step-2 Enter the number
Step-3 set a loop up to number-1
Step-4 Check the number is divide by any number other than one and the
number itself
Step-5 If divide absolutely than print the number is not a prime
Step-6 If not divide other then one and itself then print the number is prime.
Step-7 Stop
Program: 4

#include<stdio.h>
#include<conio.h>
void main()
{
int num,i=2;
clrscr();
printf("Enter the number :");
scanf("%d",&num);
while(i<=num-1)
{
if(num%i==0)
{
printf("The given number is not a prime number");
break;
}
i++;
}
if(i==num)
{
printf("The given number is a prime");
}
getch();
}
Output:

Enter the number :5


The given number is a prime
Ex.No: 5 Write a simple C program to Generate Fibonacci Series
Date :

Aim:
To write a program to generate the Fibonacci series

Algorithm:

Step-1 Start the program


Step-2 Enter the number
Step-3 Check the number whether the number is zero or not. If
Zero print Zero value. If not zero go further.
Step-4 Set a loop up to the given number.
Step-5 fib=fib+a;
a=b;
b=c;
Step-6 Every increment in the loop prints the value of fib.
Step-7 After the execution of the loop stops the program
Program: 5

#include<stdio.h>
#include<conio.h>
void main()
{
int num,fib=0,a=0,b=1,i;
clrscr();
printf("Enter the number :");
scanf("%d",&num);
printf("\nFIBONACCI SERIES\n");
if(num==0)
printf("0");
else
{
for(i=0;i<num;i++)
{
fib=fib+a;
a=b;
b=fib;
printf("%d\n",fib);
}
}
getch();
}
Output:

Enter the number :5

FIBONACCI SERIES
0
1
1
2
3
Ex.No: 6 Write a simple C program to find Palindrome or Not
Date :

Aim:
To find sum of Digits, Reverse and the given Number is Palindrome or not.

Algorithm:

Step-1 Start the program


Step-2 Enter the number
Step-3 Set a loop upto the number is not equal to zero
Step-4 Find the digit of the number
Step-5 Find the sum of digit
Step-6 Find the reverse number
Step-7 After the end of the loop print the sum and reverse number of the digit
Step-8 Find whether the reverse number is equal to the given number or not. If
equal the number is palindrome
Step-9 If not equal the given number is not palindrome
Step-10 Stop
Program: 6

#include<stdio.h>
main()
{
unsigned long int a,num,sum=0,rnum=0,rem;
printf(“\nEnter the number...”);
scanf(“%ld”,&num);
a=num;
while(num!=0)
{
rem=num%10;
sum=sum+rem;
rnum=rnum*10+rem;
num=num/10;
}
printf(“\nThe sum of the digits of %ld is %ld\n”,a,sum);
printf(“\nThe reverse number of the %ld is %ld”,a,rnum);
if(a==rnum)
printf(“\nThe given number is a palindrome”);
else
printf(“\nThe given number is not a palindrome”);
}
Output:

Enter the number...12321


The sum of the digits of 12321 is 9
The reverse number of the 12321 is 12321
The given number is a palindrom
Ex.No: 7 Write a simple C program to find String Length without using library function
Date :

Aim:
To write a program to find the string length without using String
function.

Algorithm:

Step-1 Start the program


Step-2 Enter the string
Step-3 Find the string length using the function strlen()
Step-4 Print the string length of the entered string
Step-5 Print the length of the string
Step-6 Stop
Program: 7

#include<stdio.h>
#include<conio.h>
void main()
{
char str[40];
int len;
clrscr();
printf("Enter the string :");
scanf("%s",str);
for(len=0;str[len]!='\0';len++);
printf("Length of the string :%d",len);
getch();
}
Output:

Enter the string :madam


Length of the string :5
Ex.No: 8 Write a simple C program for Matrix Multiplication
Date :

Aim:
To write a program to multiply two matrixes.

Algorithm:

Step-1 Start the program


Step-2 Enter the row and column of the A matrix
Step-3 Enter the row and column of the B matrix
Step-4 Enter the elements of the A matrix
Step-5 Enter the elements of the B matrix
Step-6 Print the elements of the A matrix in matrix form
Step-7 Print the elements of the B matrix in matrix form
Step-8 Set a loop up to row
Step-9 Set a inner loop up to column
Step-10 Set another inner loop up to column
Step-11 Multiply the A and B matrix and store the element in the C matrix
Step-12 Print the resultant matrix
Step-13 Stop
Program: 8

#include<stdio.h>
#include<conio.h>
void main()
{
int a[25][25],b[25][25],c[25][25],i,j,k,r,s;
int m,n;
clrscr();
printf("Enter the no.of rows and column of A matrix :");
scanf("%d%d",&m,&n);
printf("\nEnter the no.of rows and column of B matrix :");
scanf("%d%d",&r,&s);
if(m!=r)
printf("\nThe matrix cannot multiplied");
else
{
printf("\nEnter the elements of A matrix :\n");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
scanf("%d",&a[i][j]);
}
printf("\nEnter the elements of B matrix :\n");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
scanf("%d",&b[i][j]);
}
printf("The multiplication of two matrixes :\n");
for(i=0;i<m;i++)
{
printf("\n");
for(j=0;j<n;j++)
{
c[i][j]=0;
for(k=0;k<m;k++)
c[i][j]=c[i][j]+a[i][k]*b[k][j];
printf("\t%d",c[i][j]);
}
}
}
getch();
}

Output:

Enter the no.of rows and column of A matrix :3 3

Enter the no.of rows and column of B matrix :3 3

Enter the elements of A matrix :


123456789

Enter the elements of B matrix :


123456789

The multiplication of two matrixes :

30 36 42
66 81 96
102 126 150
Ex.No: 9 Write a simple C program to arrange the Numbers in ascending order
Date :

Aim:
To write a program to print the ascending of the given array.

Algorithm:

Step-1 Start the program


Step-2 Enter the size of the array
Step-3 Enter the elements of the array
Step-4 Set a loop up to the array size minus one
Step-5 Set a inner loop up to the size of the array
Step-6 Check whether the next array element is greater than or
not
Step-7 If greater than exchange their position
Step-8 If not greater than then go to the loop
Step-9 After the execution of the inner loop the outer loop is executed
Step-10 Print the ascending order of the given array
Step-11 Stop
Program: 9

#include<stdio.h>
#include<conio.h>

void main()
{
int i,j,k,n;
float a[50],temp;
clrscr();
printf("Enter the number how many number you want to sort\n");
scanf("%d",&n);

printf("Enter the %d Element",n);


for(i=0;i<n;i++)
{
scanf("%f",&a[i]);
}

for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)
{
if(a[i]>a[j])
{

temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}

printf("Ascending Order \n");

for(i=0;i<n;i++)
{
printf("%.2f\n",a[i]);
}

getch();
}

Output:

Enter the number how many number you want to sort


5
Enter the numbers
10 30 50 60 20
The ascending order of the given numbers
10 20 30 50 60
Ex.No: 10 Write a simple C program to find factorial using Recursion function
Date :

Aim:

To write a program to find the factorial of the given number using recursion

Algorithm:

Step-1 Start the program


Step-2 Enter the number
Step-3 Call the recursive function passing the number to the recursivefunction
as an argument.
Step-4 If the entered number is equal to one then return one to main function.
Step-5 If the number is less greater then one then call recursive
Step-6 Print the factorial value of the number.
Step-7 Stop
Program: 10

#include<stdio.h>
#include<conio.h>
int rec(int);
void main()
{
int a;
clrscr();
printf("Enter the number :");
scanf("%d",&a);
printf("The factorial of %d = %d",a,rec(a));
getch();
}
int rec(int x)
{
int f;
if(x==1)
return(1);
else
f=x*rec(x-1);
return(f);
}
Output:

Enter the number :5


The factorial of 5 = 120
Ex.No: 11 a Write a simple C program to implement Call by Value
Date :

Aim:

To write a program to illustrate a function for call by value.

Algorithm:

Step-1 Start the program


Step-2 Enter the number
Step-3 Call the function with arguments passed to it
Step-4 Multiply the number three times in the calling function
Step-5 Return the value to the called function from the calling function
Step-6 Print the cube root value in the main function
Step-7 End
Program: 11 a

#include<stdio.h>
#include<conio.h>
int cube(int);
void main()
{
int a;
clrscr();
printf("Enter the value :");
scanf("%d",&a);
printf("The value of cube is %d",cube(a));
getch();
}
int cube(int x)
{
int c;
c=x*x*x;
return(c);
}
Output:

Enter the value :3


The value of cube is 27
Ex.No: 11 b Write a simple C program to implement Call by Reference
Date :

Aim:

To write a program to swap two number without using pointer

Algorithm:

Step-1 Start the program


Step-2 Enter the two numbers
Step-3 Call the display function
Step-4 Pass the address of the two numbers to the calling
function
Step-5 Get the address in the calling function in the pointer
Step-6 Swap the number using temporary variable
Step-7 Print the swamped values in the main function
Step-8 Stop
Program: 11 b

#include<stdio.h>
#include<conio.h>
int swap(int*,int*);
void main()
{
int a,b;
clrscr();
printf("Enter the value of a and b:");
scanf("%d%d",&a,&b);
swap(&a,&b);
printf("After swapping a=%d\tb=%d\n",a,b);
getch();
}
int swap(int *x,int *y)
{
int t;
t=*x;
*x=*y;
*y=t;
return(0);
}
Output:

Enter the value of a and b:5 10


After swapping a=10 b=5
Ex.No: 12 Write a C program for Student Detail using Structure
Date :

Aim:
To write a program to print the student name, roll no, average mark and their grades.

Algorithm:

Step-1 Start the program


Step-2 Initialize the structure variable
Step-3 Enter the number of student
Step-4 Set a loop up to the number of student
Step-5 Enter the student name, roll no, average marks
Step-6 Find their grades
Step-7 Print the student name, roll no, average and their grade
Step-9 Stop
Program: 12

#include<stdio.h>
main()
{
struct student
{
char name[25];
char regno[25];
int avg;
char grade;
} stud[50],*pt;
int i,no;
printf(“Enter the number of the students...”);
scanf(“%d”,&no);
for(i=0;i<no;i++)
{
printf(“\n student[%d] information:\n”,i+1);
printf(“Enter the name”);
scanf(“%s”,stud[i].name);
printf(“\nEnter the roll no of the student”);
scanf(“%s”,stud[i].regno);
printf(“\nEnter the average value of the student”);
scanf(“%d”,&stud[i].avg);
}
pt=stud;
for(pt=stud;pt<stud+no;pt++)
{
if(pt->avg<30)
pt->grade=’D’;
else if(pt->avg<50)
pt->grade=’C’;
else if(pt->avg<70)
pt->grade=’B’;
else
pt->grade=’A’;
}
printf(“\n”);
printf(“NAME REGISTER-NO AVERAGE GRADE\n”);
for(pt=stud;pt<stud+no;pt++)
{
printf(“%-20s%-10s”,pt->name,pt->regno);
printf(“%10d \t %c\n”,pt->avg,pt->grade);
}
}

Output:

Enter the number of the students


3
student[1] information:
Enter the name MUNI
Enter the roll no of the student 100
Enter the average value of the student 95
student[2] information:
Enter the name LAK
Enter the roll no of the student 200
Enter the average value of the student 55
student[3] information:
Enter the name RAJA
Enter the roll no of the student 300
Enter the average value of the student 25
NAMEREGISTER-NO AVERAGE GRADE
MUNI 100 95 A
LKA 200 55 B
RAJA 300 25 D

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