SlideShare a Scribd company logo
A
LABORATORY
FILE ON
COMPUTER
APPLICATIONS
SUBMIITTED BY:
MUGDHA SHARMA
2084044
M.Sc. BIOTECHNOLOGY 1ST SEM
SUBMITTED TO:
Ms. HIMANI VERMA
SERIAL
NO.
NAME OF EXPERIMENT PAGE NO:
1.
TO DEMONSTRATETHE
PROGRAMFOR CONDITIONAL
STATEMENTS.
1-14
2.
TO PERFORMMATRICES
(ADDITIONAND
MULTIPLICATION) 15-21
3.
TO DEMONSTRATETHE
PROGRAMFOR ARRAY
FUNCTION 22-25
4. TO PERFORMMAIL MERGE
26-31
5.
USE OF EXCEL BY PERFORMING
BASIC EXCEL FORMULAS 32-42
INDEX
1
PRACTICAL NO: 01
TO DEMONSTRATE PROGRAMS FOR
CONDITIONAL STATEMENTS
2
Conditional Statements in C
programming
 ConditionalStatements in C programming is used to make
decisions based on the conditions.
 Conditionalstatements execute sequentiallywhen there is no
condition around thestatements.
 If you put some condition for a block of statements, the
execution flow may change based on the result evaluated by
the condition.
 This process is called decisionmaking in 'C.'
 There are following types of conditionalstatements in C;-
 IF Statement
 IF -ELSE Statement
 Nested IF-ELSE Statement
 IF-ELSE-IF Statement
 Switch Statement
 The conditionalstatements (if, if-else and switch) allows us to
choose which statement will be executed next.
 Each choice or decision is based on the value of a Boolean
expression  condition.
Types
3
IF Statement
 One of the most powerful Conditional Statement, which is used to
execute a set of statement on some conditions or responsible for
modifying the flow of execution of a program.
 The condition must be of Boolean type expression.
 BOOLEAN TYPE EXPRESSION- an expression, which returns
only two values either TRUE or FALSE.
 An if statement consists of a Boolean expression followed by one or
more statements.
 If the expression is evaluated to nonzero (true) then if block
statement(s) are executed
 .If the expression is evaluated to zero (false) then Control
passes to the next statement following it
4
Write a program to demonstrate If conditional statement
#include<stdio.h>
int main()
{
int a;
printf("Enter positive number : ");
scanf("%d",&a);
if(a%2 == 0)
{
printf("%d is Even number n", a);
}
return 0;
}
OUTPUT
INPUT
5
Write a program to demonstrate If conditional statement
(ONLINE COMPILER)
O
OUTPUT
INPUT
6
IF-ELSE Statement
 If-else statement in C language is used to execute the code if
condition is TRUE or FALSE.
 It is called TWO – WAY SELECTION STATEMENT.
 If the value of test expression is TRUE, then the true block
statement will be executed.
 If the value of test expression is FALSE, then the false block of
statement will be executed.
7
 After execution, the control will be automatically transferred to
the statements appearing outside the block of IF.
Example
Write a program to demonstrate if-else conditional statement
INPUT;
OUTPUT;
#include<stdio.h>
int main()
{
int num=19;
if(num<10)
{
printf("The value is less than 10");
}
else
{
printf("The value is greater than 10");
}
return 0;
}
OUTPUT
INPUT
8
Write a program to demonstrate If - Else conditional
statement.
(ONLINE COMPILER)
Input
OUTPUT
INPUT
9
Nested IF-ELSE Statement
 When a series of decision is required, nested if-else is used.
 Nesting means using one if-else construct with another one.
Write a program to demonstrate Nested If-Else conditional
statement
#include<stdio.h>
int main()
{
int num=1;
if(num<10)
{
if(num==1)
{
printf("The value is:%dn",num);
}
else
{
printf("The value is greater than 1");
}
}
else
{
printf("The value is greater than 10");
}
return 0;
}
OUTPUT
10
Write a program to demonstrate Nested If-Else conditional
statement.
(ONLINE COMPILER)
Input
Output
OUTPUT
INPUT
11
IF-ELSE-IF Ladder Statement
 The ladder statement is used to execute one code from multiple
conditions.
 It is also called Multipath Decision Statement.
 It is a chain of if else statement in which each if statement is
associated with else if statement and last would be else statement.
12
Write a program to demonstrate If-Else IF Ladder conditional
statement.
#include<conio.h>
void main( )
{
int a;
printf("enter a number");
scanf("%d",&a);
if( a%5==0 && a%8==0)
{
printf("divisible by both 5 and 8");
}
else if( a%8==0 )
{
printf("divisible by 8");
}
else if(a%5==0)
{
printf("divisible by 5");
}
else
{
printf("divisible by none");
}
getch();
}
OUTPUT
INPUT
13
Write a program to demonstrate If-Else IF Ladder conditional
statement.
(ONLINE COMPILER)
OUTPUT
INPUT
14
Switch Statement
 Switch statement acts as a substitute for a long if-else-if ladder that is
used to test a list of cases.
 A switch statement contains one or more case labels which are tested
against the switch expression.
 When the expression match to a case then the associated statements
with that case would be executed.
#include <stdio.h>
int main() {
int num = 8;
switch (num) {
case 7:
printf("Value is 7");
break;
case 8:
printf("Value is 8");
break;
case 9:
printf("Value is 9");
break;
default:
printf("Out ofrange");
break;
}
return 0;
}
OUTPUT
15
Write a program to demonstrate Switch conditional
statement.
(ONLINER COMPILER)
OUTPUT
INPUT
16
TO DEMONSTRATE MATRICES
(ADDITION AND MULTIPLICATION)
PRACTICAL NO: 02
17
MATRIX
 Matrix is a two-dimensional array.
 To represent the two-dimensional array there should be two loops;
 outer loop represents row of the matrix
 inner loop represents the column of the matrix.
TWO-DIMENSIONAL ARRAYS AREDECLARED AS FOLLOWS:
MATRIX ADDITION IN C
 Matrix addition in C language is to add two matrices, i.e., compute
their sum and print it.
 A user inputs their orders (number of rows and columns) and the
matrices.
 For example, if the order is 2, 2, i.e., two rows and two columns and
the matrices are:
Type array_name[row_size][column_size]
eg; Int a [2][2]
First matrix:
1 2
3 4
Second matrix:
4 5
1 5
The output is:
5 7
2 9
18
C Program for matrix addition:
INPUT
#include <stdio.h>
int main()
{
int m, n, c, d, first[10][10], second[10][10], sum[10][10];
printf("Enter the number of rows and columns of matrixn");
scanf("%d%d", &m, &n);
printf("Enter the elements of first matrixn");
for (c = 0; c < m; c++)
for (d = 0; d < n; d++)
scanf("%d", &first[c][d]);
printf("Enter the elements of second matrixn");
for (c = 0; c < m; c++)
for (d = 0 ; d < n; d++)
scanf("%d", &second[c][d]);
printf("Sum of entered matrices:-n");
for (c = 0; c < m; c++) {
for (d = 0 ; d < n; d++) {
sum[c][d] = first[c][d] + second[c][d];
printf("%dt", sum[c][d]);
}
printf("n");
}
return 0;
}
OUTPUT
INPUT
19
C Program for matrix addition:
OUTPUT
OUTPUT
INPUT
20
MATRIX MULTIPLICATION IN C
 In matrix multiplication, first matrix one row element is
multiplied by second matrix all column elements.
 For example, the matrix multiplication of 2*2 and 3*3
matrices;
21
INPUT:
OUTPUT:
22
C program in matrix multiplication
OUTPUT
INPUT:
23
PRACTICAL NO: 03
TO DEMONSTRATE ARRAY
FUNCTION
24
ARRAY FUNCTION
Array function in C is a type of data structure that holds multiple elements
are collected in a sequential manner.
There can be different dimensions of arrays and C programming does not
limit the number of dimensions in an array.
For example, if we want to store 100 integers, you can create an array for
it.
To declare an array
For eg.;
float mark[5]
(here, we declare an array, mark, of floating –point type. And it’s size is 5
i.e., it can hold 5 floating –point values)
Int data[100]
dataType arrayName[arraySize]
25
1D ARRAY PROGRAM TO CALCULATE THE AVERAGE
INPUT
OUTPUT
26
2D ARRAY PROGRAM TO CALCULATE THE MATRICES
INPUT
OUTPUT
27
PRACTICAL NO: 04
TO PERFORM MAIL MERGE
28
Mail Merge
 Mail merges are one of the quickest ways to customize documents
like emails, newsletters, and other personalized messages.
 A mail merge lets you create personalized documents that
automatically vary on a recipient-by-recipient basis.
 This spares you the trouble of manually personalizing each document
yourself!
Two key components of mail merge:
1. TEMPLATE FILE: this is the document that you’ll be sending
out like a letter or an email. It contains placeholders of the
personalization data (names, addresses, etc.) that are fetched
from a data file.
2. DATA FILE: this is a data source like a Microsoft Excel
spreadsheet or a Google Sheets file. It contains the personalized
information (names, addresses, etc.) that will be added to your
template file.
29
 TEMPLATE BODY (Body of letter)
30
 DATA FILE
31
FINAL OUTPUT
(For all the recipients)
THE FINAL OUTPUTS FOR ALL THE RECIPIENTS ARE AS FOLLOWS;
32
33
Practical: 05
USE OF MICROSOFT EXCEL
34
COMPUTATION OF:
 MEAN
 STANDARD DEVIATION
 VARIANCE
 T-TEST
(USING MS EXCEL)
The “average” number is found by adding all data points and dividing by
the number of data.
Example: The mean of 7, 5, 9, 1, 2, 8 is (7+ 5+ 9+ 1+ 2+ 8)/2 = 32/6=
5.333
COMPUTATION OF MEAN:
1. Enter the scores in one of the columns on the Excel Spreadsheet
2. Place the cursor where you wish to have mean appear and click the
mouse button
3. Select insert function from the Formulas Tab. A dialog will appear.
4. Select AVERAGE from the statistical category and click OK.
5. Enter the cell range for your list of numbers in the number 01 box.
For example: if your data were in column A from row 1 to 6, you
would enter A1:A6
6. .After entering range click OK button of the dialog box. The mean for
the list will appear in the cell you selected.
MEAN
35
36
Standard deviation is a measure of the amount of variation or dispersion of
a set of values.
A low standard deviation indicates that the values tend to be close to the
men of the set, while a high standard deviation indicates that the values are
spread out over a wider range.
COMPUTATION OF STANDARD DEVIATION:
1. Place the cursor where you wish to have the standard deviation
appear and click the mouse button. Select Insert Function from the
Formulas Tab.
2. A dialog box will appear. Select STDEV.S (for a sample) from
statistical category ( NOTE: If data is for a population, click on
STDEV.P)
3. After you have made your selections, click on OK button at the
bottom of the dialog box.
4. Enter the cell range for your list of numbers in the number 01 box.
For example, if your data were in column A from row I to row 6, you
would enter A1:A6.
5. Instead of typing the range you can also move the cursor to the
beginning of the set of scores you wish to use and click and drag the
cursor across them.
6. Once you have entered the range for your list, click on OK button at
the bottom of the dialog box. The standard deviation for the list will
appear in the cell you selected.
Standard Deviation
37
38
39
Variance is the measure of variability of a data set that indicates how far
different values are spread. Mathematically, it is defined as the average of
the squared differences from the mean.
COMPUTATION OF VARIANCE
1. When working with a numeric set of data you can use any of the
above functions to calculate sample variance in excel.
2. As an example, let’s find the variance of a sample consisting of 6
items (B2;B7). For this, you can use one of the below formulas:
 VAR(B2:B7)
 VAR.S(B2:B7)
Variance
40
41
The T test is to determine whether two samples are likely to have come
from the same two underlying populations that has the same mean.
SYNTAX
T TEST (array1, array2, tails, type)
Array1 is the first data set.
Array2 is the second data set.
Tails specifies the number of distribution tails.
If tails=1, T TEST uses one the one-tailed distribution
If tails=2, T TEST uses the two-tailed distribution.
Type is the kind of T-TEST to perform
1- Paired
2- Two sample equal variance (homoscedastic)
3- Two sample unequal variance (heteroscedastic)
T- TEST
42
43

More Related Content

PPTX
18CSS101J PROGRAMMING FOR PROBLEM SOLVING
PPTX
Unit 3
PPTX
PL SQL Quiz | PL SQL Examples
PPS
02 iec t1_s1_oo_ps_session_02
PDF
DOCX
Field symbols
DOCX
Fieldsymbols
18CSS101J PROGRAMMING FOR PROBLEM SOLVING
Unit 3
PL SQL Quiz | PL SQL Examples
02 iec t1_s1_oo_ps_session_02
Field symbols
Fieldsymbols

What's hot (20)

PDF
Power of call symput data
PDF
C programming part4
PPT
Ch3 repetition
PDF
Cp module 2
PPTX
C Programming Unit-1
PPT
5 format
PPT
Ch1 principles of software development
PDF
1584503386 1st chap
PDF
cp Module4(1)
PPT
3. control statements
PDF
"Excelling in Excel" workshop
PPT
C# Tutorial MSM_Murach chapter-04-slides
PDF
Unit ii chapter 2 Decision making and Branching in C
PPTX
Sample for Simple C Program - R.D.Sivakumar
PPTX
COM1407: Program Control Structures – Decision Making & Branching
PPTX
Decision Making and Branching
PDF
programming fortran 77 Slide02
PDF
CP Handout#4
PPT
03a control structures
PDF
CP Handout#6
Power of call symput data
C programming part4
Ch3 repetition
Cp module 2
C Programming Unit-1
5 format
Ch1 principles of software development
1584503386 1st chap
cp Module4(1)
3. control statements
"Excelling in Excel" workshop
C# Tutorial MSM_Murach chapter-04-slides
Unit ii chapter 2 Decision making and Branching in C
Sample for Simple C Program - R.D.Sivakumar
COM1407: Program Control Structures – Decision Making & Branching
Decision Making and Branching
programming fortran 77 Slide02
CP Handout#4
03a control structures
CP Handout#6
Ad

Similar to MSc COMPUTER APPLICATION (20)

PPTX
C and C++ programming basics for Beginners.pptx
PPTX
Control Structures in C
PDF
Principals of Programming in CModule -5.pdfModule_2_P2 (1).pdf
PDF
Control statements-Computer programming
PPT
C-Programming Chapter 1 Fundamentals of C.ppt
PPT
C-Programming Chapter 1 Fundamentals of C.ppt
PPT
C-Programming Chapter 1 Fundamentals of C.ppt
PPT
C-Programming Fundamentals of C (1).ppt
PPT
C-Programming Chapter 1 Fundamentals of C.ppt
DOC
c programing
PPTX
C Programming Unit-2
PPTX
C decision making and looping.
PPTX
3Arrays, Declarations, Expressions, Statements, Symbolic constant.pptx
PDF
Lesson 2 C STATEMENT IN PROGRAMMING (M).pdf
PDF
C and Data structure lab manual ECE (2).pdf
PPTX
Basics of Control Statement in C Languages
PPSX
Algorithms, Structure Charts, Corrective and adaptive.ppsx
PDF
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
PDF
ICP - Lecture 7 and 8
C and C++ programming basics for Beginners.pptx
Control Structures in C
Principals of Programming in CModule -5.pdfModule_2_P2 (1).pdf
Control statements-Computer programming
C-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Chapter 1 Fundamentals of C.ppt
C-Programming Fundamentals of C (1).ppt
C-Programming Chapter 1 Fundamentals of C.ppt
c programing
C Programming Unit-2
C decision making and looping.
3Arrays, Declarations, Expressions, Statements, Symbolic constant.pptx
Lesson 2 C STATEMENT IN PROGRAMMING (M).pdf
C and Data structure lab manual ECE (2).pdf
Basics of Control Statement in C Languages
Algorithms, Structure Charts, Corrective and adaptive.ppsx
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
ICP - Lecture 7 and 8
Ad

Recently uploaded (20)

PDF
GROUP 2 ORIGINAL PPT. pdf Hhfiwhwifhww0ojuwoadwsfjofjwsofjw
PPT
Mutation in dna of bacteria and repairss
PPTX
GREEN FIELDS SCHOOL PPT ON HOLIDAY HOMEWORK
PPTX
Microbes in human welfare class 12 .pptx
PPT
1. INTRODUCTION TO EPIDEMIOLOGY.pptx for community medicine
PPTX
PMR- PPT.pptx for students and doctors tt
PPTX
Seminar Hypertension and Kidney diseases.pptx
PPTX
BIOMOLECULES PPT........................
PDF
CHAPTER 3 Cell Structures and Their Functions Lecture Outline.pdf
PDF
BET Eukaryotic signal Transduction BET Eukaryotic signal Transduction.pdf
PDF
Worlds Next Door: A Candidate Giant Planet Imaged in the Habitable Zone of ↵ ...
PPT
LEC Synthetic Biology and its application.ppt
PDF
Worlds Next Door: A Candidate Giant Planet Imaged in the Habitable Zone of ↵ ...
PPTX
A powerpoint on colorectal cancer with brief background
PPT
Presentation of a Romanian Institutee 2.
PPTX
ap-psych-ch-1-introduction-to-psychology-presentation.pptx
PPTX
Fluid dynamics vivavoce presentation of prakash
PDF
Communicating Health Policies to Diverse Populations (www.kiu.ac.ug)
PPTX
TORCH INFECTIONS in pregnancy with toxoplasma
PPTX
INTRODUCTION TO PAEDIATRICS AND PAEDIATRIC HISTORY TAKING-1.pptx
GROUP 2 ORIGINAL PPT. pdf Hhfiwhwifhww0ojuwoadwsfjofjwsofjw
Mutation in dna of bacteria and repairss
GREEN FIELDS SCHOOL PPT ON HOLIDAY HOMEWORK
Microbes in human welfare class 12 .pptx
1. INTRODUCTION TO EPIDEMIOLOGY.pptx for community medicine
PMR- PPT.pptx for students and doctors tt
Seminar Hypertension and Kidney diseases.pptx
BIOMOLECULES PPT........................
CHAPTER 3 Cell Structures and Their Functions Lecture Outline.pdf
BET Eukaryotic signal Transduction BET Eukaryotic signal Transduction.pdf
Worlds Next Door: A Candidate Giant Planet Imaged in the Habitable Zone of ↵ ...
LEC Synthetic Biology and its application.ppt
Worlds Next Door: A Candidate Giant Planet Imaged in the Habitable Zone of ↵ ...
A powerpoint on colorectal cancer with brief background
Presentation of a Romanian Institutee 2.
ap-psych-ch-1-introduction-to-psychology-presentation.pptx
Fluid dynamics vivavoce presentation of prakash
Communicating Health Policies to Diverse Populations (www.kiu.ac.ug)
TORCH INFECTIONS in pregnancy with toxoplasma
INTRODUCTION TO PAEDIATRICS AND PAEDIATRIC HISTORY TAKING-1.pptx

MSc COMPUTER APPLICATION

  • 1. A LABORATORY FILE ON COMPUTER APPLICATIONS SUBMIITTED BY: MUGDHA SHARMA 2084044 M.Sc. BIOTECHNOLOGY 1ST SEM SUBMITTED TO: Ms. HIMANI VERMA
  • 2. SERIAL NO. NAME OF EXPERIMENT PAGE NO: 1. TO DEMONSTRATETHE PROGRAMFOR CONDITIONAL STATEMENTS. 1-14 2. TO PERFORMMATRICES (ADDITIONAND MULTIPLICATION) 15-21 3. TO DEMONSTRATETHE PROGRAMFOR ARRAY FUNCTION 22-25 4. TO PERFORMMAIL MERGE 26-31 5. USE OF EXCEL BY PERFORMING BASIC EXCEL FORMULAS 32-42 INDEX
  • 3. 1 PRACTICAL NO: 01 TO DEMONSTRATE PROGRAMS FOR CONDITIONAL STATEMENTS
  • 4. 2 Conditional Statements in C programming  ConditionalStatements in C programming is used to make decisions based on the conditions.  Conditionalstatements execute sequentiallywhen there is no condition around thestatements.  If you put some condition for a block of statements, the execution flow may change based on the result evaluated by the condition.  This process is called decisionmaking in 'C.'  There are following types of conditionalstatements in C;-  IF Statement  IF -ELSE Statement  Nested IF-ELSE Statement  IF-ELSE-IF Statement  Switch Statement  The conditionalstatements (if, if-else and switch) allows us to choose which statement will be executed next.  Each choice or decision is based on the value of a Boolean expression condition. Types
  • 5. 3 IF Statement  One of the most powerful Conditional Statement, which is used to execute a set of statement on some conditions or responsible for modifying the flow of execution of a program.  The condition must be of Boolean type expression.  BOOLEAN TYPE EXPRESSION- an expression, which returns only two values either TRUE or FALSE.  An if statement consists of a Boolean expression followed by one or more statements.  If the expression is evaluated to nonzero (true) then if block statement(s) are executed  .If the expression is evaluated to zero (false) then Control passes to the next statement following it
  • 6. 4 Write a program to demonstrate If conditional statement #include<stdio.h> int main() { int a; printf("Enter positive number : "); scanf("%d",&a); if(a%2 == 0) { printf("%d is Even number n", a); } return 0; } OUTPUT INPUT
  • 7. 5 Write a program to demonstrate If conditional statement (ONLINE COMPILER) O OUTPUT INPUT
  • 8. 6 IF-ELSE Statement  If-else statement in C language is used to execute the code if condition is TRUE or FALSE.  It is called TWO – WAY SELECTION STATEMENT.  If the value of test expression is TRUE, then the true block statement will be executed.  If the value of test expression is FALSE, then the false block of statement will be executed.
  • 9. 7  After execution, the control will be automatically transferred to the statements appearing outside the block of IF. Example Write a program to demonstrate if-else conditional statement INPUT; OUTPUT; #include<stdio.h> int main() { int num=19; if(num<10) { printf("The value is less than 10"); } else { printf("The value is greater than 10"); } return 0; } OUTPUT INPUT
  • 10. 8 Write a program to demonstrate If - Else conditional statement. (ONLINE COMPILER) Input OUTPUT INPUT
  • 11. 9 Nested IF-ELSE Statement  When a series of decision is required, nested if-else is used.  Nesting means using one if-else construct with another one. Write a program to demonstrate Nested If-Else conditional statement #include<stdio.h> int main() { int num=1; if(num<10) { if(num==1) { printf("The value is:%dn",num); } else { printf("The value is greater than 1"); } } else { printf("The value is greater than 10"); } return 0; } OUTPUT
  • 12. 10 Write a program to demonstrate Nested If-Else conditional statement. (ONLINE COMPILER) Input Output OUTPUT INPUT
  • 13. 11 IF-ELSE-IF Ladder Statement  The ladder statement is used to execute one code from multiple conditions.  It is also called Multipath Decision Statement.  It is a chain of if else statement in which each if statement is associated with else if statement and last would be else statement.
  • 14. 12 Write a program to demonstrate If-Else IF Ladder conditional statement. #include<conio.h> void main( ) { int a; printf("enter a number"); scanf("%d",&a); if( a%5==0 && a%8==0) { printf("divisible by both 5 and 8"); } else if( a%8==0 ) { printf("divisible by 8"); } else if(a%5==0) { printf("divisible by 5"); } else { printf("divisible by none"); } getch(); } OUTPUT INPUT
  • 15. 13 Write a program to demonstrate If-Else IF Ladder conditional statement. (ONLINE COMPILER) OUTPUT INPUT
  • 16. 14 Switch Statement  Switch statement acts as a substitute for a long if-else-if ladder that is used to test a list of cases.  A switch statement contains one or more case labels which are tested against the switch expression.  When the expression match to a case then the associated statements with that case would be executed. #include <stdio.h> int main() { int num = 8; switch (num) { case 7: printf("Value is 7"); break; case 8: printf("Value is 8"); break; case 9: printf("Value is 9"); break; default: printf("Out ofrange"); break; } return 0; } OUTPUT
  • 17. 15 Write a program to demonstrate Switch conditional statement. (ONLINER COMPILER) OUTPUT INPUT
  • 18. 16 TO DEMONSTRATE MATRICES (ADDITION AND MULTIPLICATION) PRACTICAL NO: 02
  • 19. 17 MATRIX  Matrix is a two-dimensional array.  To represent the two-dimensional array there should be two loops;  outer loop represents row of the matrix  inner loop represents the column of the matrix. TWO-DIMENSIONAL ARRAYS AREDECLARED AS FOLLOWS: MATRIX ADDITION IN C  Matrix addition in C language is to add two matrices, i.e., compute their sum and print it.  A user inputs their orders (number of rows and columns) and the matrices.  For example, if the order is 2, 2, i.e., two rows and two columns and the matrices are: Type array_name[row_size][column_size] eg; Int a [2][2] First matrix: 1 2 3 4 Second matrix: 4 5 1 5 The output is: 5 7 2 9
  • 20. 18 C Program for matrix addition: INPUT #include <stdio.h> int main() { int m, n, c, d, first[10][10], second[10][10], sum[10][10]; printf("Enter the number of rows and columns of matrixn"); scanf("%d%d", &m, &n); printf("Enter the elements of first matrixn"); for (c = 0; c < m; c++) for (d = 0; d < n; d++) scanf("%d", &first[c][d]); printf("Enter the elements of second matrixn"); for (c = 0; c < m; c++) for (d = 0 ; d < n; d++) scanf("%d", &second[c][d]); printf("Sum of entered matrices:-n"); for (c = 0; c < m; c++) { for (d = 0 ; d < n; d++) { sum[c][d] = first[c][d] + second[c][d]; printf("%dt", sum[c][d]); } printf("n"); } return 0; } OUTPUT INPUT
  • 21. 19 C Program for matrix addition: OUTPUT OUTPUT INPUT
  • 22. 20 MATRIX MULTIPLICATION IN C  In matrix multiplication, first matrix one row element is multiplied by second matrix all column elements.  For example, the matrix multiplication of 2*2 and 3*3 matrices;
  • 24. 22 C program in matrix multiplication OUTPUT INPUT:
  • 25. 23 PRACTICAL NO: 03 TO DEMONSTRATE ARRAY FUNCTION
  • 26. 24 ARRAY FUNCTION Array function in C is a type of data structure that holds multiple elements are collected in a sequential manner. There can be different dimensions of arrays and C programming does not limit the number of dimensions in an array. For example, if we want to store 100 integers, you can create an array for it. To declare an array For eg.; float mark[5] (here, we declare an array, mark, of floating –point type. And it’s size is 5 i.e., it can hold 5 floating –point values) Int data[100] dataType arrayName[arraySize]
  • 27. 25 1D ARRAY PROGRAM TO CALCULATE THE AVERAGE INPUT OUTPUT
  • 28. 26 2D ARRAY PROGRAM TO CALCULATE THE MATRICES INPUT OUTPUT
  • 29. 27 PRACTICAL NO: 04 TO PERFORM MAIL MERGE
  • 30. 28 Mail Merge  Mail merges are one of the quickest ways to customize documents like emails, newsletters, and other personalized messages.  A mail merge lets you create personalized documents that automatically vary on a recipient-by-recipient basis.  This spares you the trouble of manually personalizing each document yourself! Two key components of mail merge: 1. TEMPLATE FILE: this is the document that you’ll be sending out like a letter or an email. It contains placeholders of the personalization data (names, addresses, etc.) that are fetched from a data file. 2. DATA FILE: this is a data source like a Microsoft Excel spreadsheet or a Google Sheets file. It contains the personalized information (names, addresses, etc.) that will be added to your template file.
  • 31. 29  TEMPLATE BODY (Body of letter)
  • 33. 31 FINAL OUTPUT (For all the recipients) THE FINAL OUTPUTS FOR ALL THE RECIPIENTS ARE AS FOLLOWS;
  • 34. 32
  • 35. 33 Practical: 05 USE OF MICROSOFT EXCEL
  • 36. 34 COMPUTATION OF:  MEAN  STANDARD DEVIATION  VARIANCE  T-TEST (USING MS EXCEL) The “average” number is found by adding all data points and dividing by the number of data. Example: The mean of 7, 5, 9, 1, 2, 8 is (7+ 5+ 9+ 1+ 2+ 8)/2 = 32/6= 5.333 COMPUTATION OF MEAN: 1. Enter the scores in one of the columns on the Excel Spreadsheet 2. Place the cursor where you wish to have mean appear and click the mouse button 3. Select insert function from the Formulas Tab. A dialog will appear. 4. Select AVERAGE from the statistical category and click OK. 5. Enter the cell range for your list of numbers in the number 01 box. For example: if your data were in column A from row 1 to 6, you would enter A1:A6 6. .After entering range click OK button of the dialog box. The mean for the list will appear in the cell you selected. MEAN
  • 37. 35
  • 38. 36 Standard deviation is a measure of the amount of variation or dispersion of a set of values. A low standard deviation indicates that the values tend to be close to the men of the set, while a high standard deviation indicates that the values are spread out over a wider range. COMPUTATION OF STANDARD DEVIATION: 1. Place the cursor where you wish to have the standard deviation appear and click the mouse button. Select Insert Function from the Formulas Tab. 2. A dialog box will appear. Select STDEV.S (for a sample) from statistical category ( NOTE: If data is for a population, click on STDEV.P) 3. After you have made your selections, click on OK button at the bottom of the dialog box. 4. Enter the cell range for your list of numbers in the number 01 box. For example, if your data were in column A from row I to row 6, you would enter A1:A6. 5. Instead of typing the range you can also move the cursor to the beginning of the set of scores you wish to use and click and drag the cursor across them. 6. Once you have entered the range for your list, click on OK button at the bottom of the dialog box. The standard deviation for the list will appear in the cell you selected. Standard Deviation
  • 39. 37
  • 40. 38
  • 41. 39 Variance is the measure of variability of a data set that indicates how far different values are spread. Mathematically, it is defined as the average of the squared differences from the mean. COMPUTATION OF VARIANCE 1. When working with a numeric set of data you can use any of the above functions to calculate sample variance in excel. 2. As an example, let’s find the variance of a sample consisting of 6 items (B2;B7). For this, you can use one of the below formulas:  VAR(B2:B7)  VAR.S(B2:B7) Variance
  • 42. 40
  • 43. 41 The T test is to determine whether two samples are likely to have come from the same two underlying populations that has the same mean. SYNTAX T TEST (array1, array2, tails, type) Array1 is the first data set. Array2 is the second data set. Tails specifies the number of distribution tails. If tails=1, T TEST uses one the one-tailed distribution If tails=2, T TEST uses the two-tailed distribution. Type is the kind of T-TEST to perform 1- Paired 2- Two sample equal variance (homoscedastic) 3- Two sample unequal variance (heteroscedastic) T- TEST
  • 44. 42
  • 45. 43