Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


write the program for maximum of the following numbers?
122,198,290,71,143,325,98

Answers were Sorted based on User's Feedback



write the program for maximum of the following numbers? 122,198,290,71,143,325,98..

Answer / akhilesh singh

main()
{
int i,j,temp,a[7]={122,198,290,71,143,325,98};
for(i=0;i<=5;i++)
{
for(j=0;j<=6;j++)
{
if(a[j]<a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
printf("%d",a[0]);
}

Is This Answer Correct ?    5 Yes 0 No

write the program for maximum of the following numbers? 122,198,290,71,143,325,98..

Answer / sameer.chaudhari

main()
{
int i,a[7]={122,198,290,71,143,325,98} , max = a[0] ;

for(i = 0 ; i < 7 ; ++i)
if(max < a[i])
max = a[i] ;

printf("%d",max);
}

Is This Answer Correct ?    3 Yes 0 No

write the program for maximum of the following numbers? 122,198,290,71,143,325,98..

Answer / divya

#inclufe<stdio.h>
Void main()
{
int a[7];
for(i=0;i<=7;i++)
{
printf("Enter the nos");
scanf("%d",&a[i]);
}
for(i=0;i<=7;i++)
{
if(a[i]>a[i+1])
printf("%d",a[i]);
else
if(a[i]<a[i+1])
printf("%d",a[i+]);
else
if(a[i]==a[i+1])
printf("%d",a[i]);
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No

write the program for maximum of the following numbers? 122,198,290,71,143,325,98..

Answer / mehadi hasan

#include<stdio.h>
int main()
{
int a[50],i,max=0,num,min=200;
printf("enter num :");
scanf("%d",&num);
for(i=1;i<=num;i++)
{
printf("n%d:",i);
scanf("%d",&a[i]);
if(a[i]>max)
max=a[i];
if(min>a[i])
min=a[i];
}
printf("max is %d:\nAnd min is %d:\n",max,min);
return 0;
}

Is This Answer Correct ?    0 Yes 0 No

write the program for maximum of the following numbers? 122,198,290,71,143,325,98..

Answer / mathew varghese

#include<stdio.h>
void main()
{
int a[10]={122,198,290,71,143,325,98};
int x,i;
x=a[0];
for(i=0;i<=6;i++)
{
if(a[i]>=x)
{
x=a[i];
}
}
printf("Maximum is %d \n",x);
}

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

how to set Nth bit of variable by using MACRO

3 Answers   HCL,


When is a null pointer used?

0 Answers  


what will happen if you free a pointer twice after allocating memory dynamically ?

3 Answers   Novell,


What is 2c dna?

0 Answers  


How can you increase the allowable number of simultaneously open files?

0 Answers  


Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?

0 Answers  


Explain what is the difference between declaring a variable and defining a variable?

1 Answers  


How pointer is benefit for design a data structure algorithm?

2 Answers  


What is break in c?

0 Answers  


what does exit() do?

3 Answers   Cadence,


how to print value of e(exp1)up to required no of digits after decimal?

1 Answers  


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

0 Answers  


Categories