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

Which is the memory area not included in C program? give the reason

0 Answers   IBM, TCS,


What is identifiers in c with examples?

0 Answers  


Why pointers are used in c?

0 Answers  


What are c header files?

0 Answers  


What is typedef example?

0 Answers  


writ a program to compare using strcmp VIVA and viva with its output.

0 Answers  


how can we print  hellow world programme without using semicolon

3 Answers  


How can a process change an environment variable in its caller?

0 Answers  


exit () is used to a) exit () terminates the execution of the program itself b) exit () terminates the execution of the loop c) exit () terminates the execution of the block d) none of the above

0 Answers  


what does keyword ‘extern’ mean in a function declaration?

1 Answers   Emerson,


number 2 plssssss help !!....using array.. turbo c.. create a program that will accept a number and determine if it is a happy number or an unhappy number.. example: enter a number : 7 7*7=49 then 4 and 9 4*4 and 9*9== 16 + 18 gives you 97 then 9 and 7 9*9 and 7*7 == 81 + 49 gives you 130 then 1 and 3 1*1 and 3*3 == 1 + 9 gives you 10 1*1 gives you 1 sample output: 7= 49= 16+81= 97= 81+49=130 =1+9=10 =1 "7 is a happy number" . if the last number is 2 then the number being inputed is not a happy number.

3 Answers  


Write a program to write a given string in maximum possibilities? i.e str[5]="reddy"; i.e we can write this string in 120 ways for that write a program

3 Answers   Subex,


Categories