Click

  
#include <stdio.h>
#include <windows.h>
#include <conio.h>
#define SIZE 100

void main()
{

char ch;
int size=0, a[SIZE], i=0, b=0, temp=0, x=0, w, largest=0, largest2=0, q;
int c;
do{

printf("Enter how many numbers you want to input: ");
scanf("%d",&size);
printf("Enter %d numbers you want to enter: ", size);
for(i=0;i<size;i++){
scanf("%d", &a[i]);

}

printf("\n");
printf("\n");
printf("This are the numbers u entered: ");
for(b=0;b<size;++b){
printf(" %d", a[b]);
}

//largest
for(w=0;w<size;w++){
if(largest<a[w])
largest=a[w];

}

printf("\nThis is the largest number you entered: %d", largest);

//2nd largest
for(q=0;q<size;q++){
if(largest>a[q]){
if(largest2<a[q]){
largest2=a[q];
}}
}

printf("\nThis is the second largest number you entered: %d", largest2);

//sorted
for(i=0;i<size;i++){
for(b=0;b<(size-(i+1));b++){
if (a[b]>a[b+1]){
temp=a[b];
a[b]=a[b+1];
a[b+1]=temp;
}}}
printf("\nThis are the sorted numbers: ");
for(x=0;x<size;++x){
printf(" %d", a[x]);
}

printf("\n");

printf("\nRun again?(y/n)");
ch = getch();

if(ch=='y'||ch=='Y'){
c=1;
system("cls");
}
else{
c=0;
}

fflush(stdin);
}while(c==1);


}