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]);
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here