- Joined
- Apr 27, 2017
- Posts
- 1,409
- Reaction
- 1,942
- Points
- 759
- Age
- 29
Ano kaya iibahin ko dito para hahanapin naman ay Smallest Element ty po
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.
#include <stdio.h>
void main() {
int a, b;
float arr[100];
float bigNum =0, smallNum = 9999;
clrscr();
printf("Enter total number of elements (1 to 1oo): ");
scanf("%i", &b);
printf("\n");
for ( a = 0; a < b; a++)
{
printf("Enter the Number %d: ",a+1);
scanf("%f", &arr[a]);
if(arr[a] > bigNum){
bigNum = arr[a];
}
if(arr[a] < smallNum){
smallNum = arr[a];
}
}
printf("Largest Element =%.2f",bigNum);
printf("\nSmallest Element =%.2f",smallNum);
getch();
}
ty boss try koC:#include <stdio.h> void main() { int a, b; float arr[100]; float bigNum =0, smallNum = 9999; clrscr(); printf("Enter total number of elements (1 to 1oo): "); scanf("%i", &b); printf("\n"); for ( a = 0; a < b; a++) { printf("Enter the Number %d: ",a+1); scanf("%f", &arr[a]); if(arr[a] > bigNum){ bigNum = arr[a]; } if(arr[a] < smallNum){ smallNum = arr[a]; } } printf("Largest Element =%.2f",bigNum); printf("\nSmallest Element =%.2f",smallNum); getch(); }