how to find out the biggest element (or any other
operation) in an array which is dynamic. User need not to
mention the array size while executing.
Answer Posted / vignesh1988i
it is said that while executing also the user should not specify the size means it can be done in another method without using ARRAYS......... using only one variable.. since it is asked to find only the biggest element , this program suits.....
#include<stdio.h>
#include<conio.h>
void main()
{
int n,BIG;
printf("enter the numbers :");
scanf("%d",&n);
BIG=n;
do
{
fflush(stdin);
scanf("%d",&n);
if(n>=BIG)
BIG=n;
}while(((char)n>=65)&&((char)<=122));
printf("the biggest number is : %d",BIG);
getch();
}
thank u
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
What is scope and lifetime of a variable in c?
What is header file definition?
Why is sprintf unsafe?
Does c have circular shift operators?
What is pre-emptive data structure and explain it with example?
What would happen to X in this expression: X += 15; (assuming the value of X is 5)
Explain what is the advantage of a random access file?
What is function prototype in c language?
What is openmp in c?
What is a MAC Address?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
write a progrmm in c language take user interface generate table using for loop?
How can you invoke another program from within a C program?
Explain what is the benefit of using enum to declare a constant?
Is javascript based on c?