🔒 Closed Patulong po mga idol

Status
Not open for further replies.
C:
#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();
}
 
C:
#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 ko
 
Status
Not open for further replies.

About this Thread

  • 2
    Replies
  • 570
    Views
  • 2
    Participants
Last reply from:
Shinki gami

Trending Topics

Online now

Members online
1,460
Guests online
3,212
Total visitors
4,672

Forum statistics

Threads
2,308,483
Posts
29,185,422
Members
1,192,016
Latest member
alanwww
Back
Top