Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

/* THE LARGEST AND SMALLEST NUMBERS */

#include<stdio.h>
#include<conio.h>
void main()
{
int x[15],large,small,i,j,n;
clrscr();
printf("\n\t\t\t ********************************");
printf("\n\t\t\t The Largest & Smallest Numbers");
printf("\n\t\t\t ********************************");
printf("\nHow many numbers to enter: ");
scanf("%d",&n);
printf("\nEnter the numbers \n");
for(i=0;i<n;i++)
{
scanf("%d",&x[i]);
}
large=x[0];
for(i=0;i<n;i++)
{
if(x[i]>large)
{
large=x[i];
}
}
printf("\n\t The largest number is: %d",large);
small=x[0];
for(j=0;j<n;j++)
{
if(x[j]<small)
{
small=x[j];
}
}
printf("\n\t The smallest number is: %d",small);
getch();
}
#include<stdio.h>
main()
{
int a[10][10],b[10][10],i,j,n,flag;
clrscr();
printf("Input order of the A matrix:");
scanf("%d",&n);
printf("Input A-matrix\n");
for(i=0;i<n;++i)
for(j=0;j<n;++j)
scanf("%d",&a[i][j]);
for(i=0;i<n;++i)
for(j=0;j<n;++j)
b[i][j]=a[j][i];
printf("Transpose of A matrix :\n");
for(i=0;i<n;++i)
{
for(j=0;j<n;++j)
printf("%5d",b[i][j]);
printf("\n");
}
for(i=0;i<n;++i)
{

for(j=0;j<n;++j)
if(a[i][j]!=b[i][j])
flag=1;
}
if(flag==1)
printf("Matrix is not symmetric\n");
else
printf("Matrix is symmetric\n");
getch();
}

You might also like