Professional Documents
Culture Documents
PROGRAM
/*program to find smallest and largest of n numbers*/
#include<stdio.h>
#include<conio.h>
void main()
{
int i, sm, a[50], la, l;
clrscr();
printf("\n SMALLEST AND LARGEST NUMBER \n\n");
printf("Enter the limit : ");
scanf("%d", &l);
printf("Enter the numbers \n");
for(i=0;i<l;i++)
{
scanf("%d", &a[i]);
}
sm = a[0];
la = a[0];
for(i=1;i<l;i++)
{
if(a[i]>la)
{
la = a[i];
}
if(a[i]<sm)
{
sm = a[i];
}
}
printf("\n Largest number : ");
printf("%d",la);
printf("\n Smallest number : ");
printf("%d", sm);
getch();
}
89
10
10
10
10
10
10
10
90
-6
-4
-2
88
}
printf("\n The elements of the matrix B are \n");
for(i=0;i<n;i++)
{
printf("\n");
for(j=0;j<m;j++)
OUTPUT
MATRIX MULTIPLICATION
Enter the rows and columns of the matrix : 3 3
Enter the elements of matrix A
123456789
Enter the elements of matrix B 1 2 9 8 7 6 5 4 6
The elements of the matrix A are
1
Resultant matrix is
32
28
39
74
67
102
116
106
165
OUTPUT
NUMBER OF OCCURENCES
Enter the limit : 5
Enter the numbers
34453
Ascending Order
1
Descending Order
7