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
When the macros gets expanded?
What is pointer to pointer in c language?
What is a const pointer in c?
Array is an lvalue or not?
What is structure of c program?
Write a program of prime number using recursion.
Using which language Test cases are added in .ptu file of RTRT unit testing???
What is the 'named constructor idiom'?
What is the difference between array and pointer in c?
What is calloc()?
How do you write a program which produces its own source code as output?
What is the difference between fread and fwrite function?
What is preprocessor with example?
Do pointers need to be initialized?
What is hashing in c?