This is an array program in C programming language. The program is running well but does not display the result. what seems to be the problem? here is the code #include void main() { int n;...


This is an array program in C programming language. The program is running well but does not display the result. what seems to be the problem? here is the code






#include
void main()
{
    int n;
    printf("Enter the size of input: ");
    scanf("%d",&n);
    int arr[100];
    printf("Enter the numbers: ");
    int i;
    for(i=0;i<>
    {
        scanf("%d",&arr[i]);
    }
    int j,temp;
    for(i=0;i<>
    {
        for(j=i+1;j<>
        {
            if(arr[j]>arr[j+1])
            {
               temp=arr[j];
               arr[j]=arr[j+1];
               arr[j+1]=temp;
            }
        }
    }
    printf("The three largest numbers are: %d %d %d",arr[n-3],arr[n-2],arr[n-1]);




Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here