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


Please Help Members By Posting Answers For Below Questions

What is structure and union in c?

605


Why c is called a mid level programming language?

608


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

670


What are Macros? What are its advantages and disadvantages?

651


Why c language?

652






What is the correct declaration of main?

682


Explain output of printf("Hello World"-'A'+'B'); ?

981


What header files do I need in order to define the standard library functions I use?

543


Difference between Function to pointer and pointer to function

637


how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

658


What are predefined functions in c?

572


Can we compile a program without main() function?

637


what do you mean by inline function in C?

620


How many levels deep can include files be nested?

655


What is the explanation for modular programming?

689