write a program to find the largest and second largest
integer from an array
Answers were Sorted based on User's Feedback
Answer / manish gupta
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5],x,y,c;
for (x=0;x<5;x++)
{
printf("enter any number");
scanf("%d",&a[x]);
}
for (x=0;x<5;x++)
{
for (y=0;y<4;y++)
{
if (a[y]>a[y+1])
{
c=a[y];
a[y]=a[y+1];
a[y+1]=c;
}
}
}
printf("\nlargest no:-%d",a[y]);
printf("\nsecond largest no:-%d",a[y-1]);
getch();
}
| Is This Answer Correct ? | 17 Yes | 8 No |
Answer / mahesh
use bubble sort next to this, print last n second from last..
| Is This Answer Correct ? | 1 Yes | 1 No |
How to develop software using "c" programming?
what is the difference between getch() and getchar()?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
Explain how to reverse singly link list.
Write a program that his output 1 12 123
what is an inline fuction??
How can I send mail from within a c program?
What are the two types of functions in c?
What is void main () in c?
Is c weakly typed?
program to find the roots of a quardratic equation
write a progam to compare the string using switch case?