🔒 Closed Patulong po mga idol

Status
Not open for further replies.
Screenshot_2022-01-14-15-56-19-828_ru.iiec.cxxdroid.webp


Ano kaya iibahin ko dito para hahanapin naman ay Smallest Element ty po
 
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
  • 567
    Views
  • 2
    Participants
Last reply from:
Shinki gami

Trending Topics

Online now

Members online
1,207
Guests online
1,074
Total visitors
2,281

Forum statistics

Threads
2,287,300
Posts
29,043,658
Members
1,216,451
Latest member
lucia Z
Back
Top