🔒 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.

Similar threads

About this Thread

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

Trending Topics

Online now

Members online
798
Guests online
2,804
Total visitors
3,602

Forum statistics

Threads
2,332,372
Posts
29,264,437
Members
1,144,256
Latest member
MizhaaaaR
Back
Top