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
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
Explain spaghetti programming?
What do header files do?
Explain how can I convert a string to a number?
What is the use of getchar() function?
Why is c called c?
Is null valid for pointers to functions?
In c programming language, how many parameters can be passed to a function ?
What are identifiers and keywords in c?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
Explain what is the difference between far and near ?
What is boolean in c?
How do you print an address?
Which is an example of a structural homology?
Explain what are bus errors, memory faults, and core dumps?