find largest element in array w/o using sorting techniques.
Answer Posted / manjunath
#include<stdio.h>
void main()
{
int a,b[4]={3,2,7,4,9};
a[0]=b[0];
for(i=1;i<5;i++)
{
if(a<b[i])
{
a=b[i];
}
}
printf("the largest num is %d",a);
}
| Is This Answer Correct ? | 3 Yes | 7 No |
Post New Answer View All Answers
how to write a c program to print list of fruits in alpabetical order?
What does the function toupper() do?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
What is a constant and types of constants in c?
What is difference between static and global variable in c?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
What does 3 periods mean in texting?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
Is c high or low level?
Can two or more operators such as and be combined in a single line of program code?
Describe how arrays can be passed to a user defined function