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 |
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
what information does the header files contain?
6 Answers BSNL, Cisco, GDA Technologies,
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
What do you mean by recursion in c?
WHOT IS CHAR?
what is the mean of c languages.
I came across some code that puts a (void) cast before each call to printf. Why?
char ch=10;printf("%d",ch);what is the output
In CMM or CMMI certified organizations,we assess only the standard software processes of the organization. We do not assess the organizations other functional departments like HR or Admin. Then how can we certify the entire organization as CMM level company?? We have assessed only software related activities. Right. There is no relation with other departments like Accounts, HR or Admin. Then how can we claim that the whole company is a CMM certified company?
Where are c variables stored in memory?
int arr[] = {1,2,3,4} int *ptr=arr; *(arr+3) = *++ptr + *ptr++; Final contents of arr[]