Hi this is a C program. I need you to convert it to a C++ program. MAke sure its working thank you. here is the program: #include void main() { int n; printf("Enter the size of input: ");...


Hi this is a C program. I need you to convert it to a C++ program. MAke sure its working thank you.


here is the program:




#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 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here