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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the ANSI C Standard?

775


What is the scope of local variable in c?

574


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

648


What is uint8 in c?

638


Is it better to use a macro or a function?

651






What are the characteristics of arrays in c?

609


If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..

1587


What is the difference between memcpy and memmove?

599


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

1492


How do I use strcmp?

634


main() { printf("hello"); fork(); }

693


What does do in c?

606


How do we declare variables in c?

561


Explain about the functions strcat() and strcmp()?

596


How do I get an accurate error status return from system on ms-dos?

645