When there is an array, receive a positive number and obtain the number of values greater than the positive number

Asked 6 days ago, Updated 6 days ago, 1 views

When there is an integer array of length 15, you receive a double positive number from the user To output how many elements are greater than or equal to that number in an array Please let me know what expression should be included in the bent part.

#include <stdio.h>

int main()

{

    int array[]={49,29,19,37,59,16,98,14,80,78,62,90,10,22,18};

    double Num_in=0;
    int count=sizeof(array)/sizeof(array[0]);
    int i,j;
    printf("Give me a number:");
    scanf("%lf",&Num_in);
    /////////
    printf("The number of elements greater than or equal:%8.6f:%d",(double)Num_in);
    return 0;

c

2022-09-20 16:22

1 Answers

You can compare them one by one using a repeating sentence.


2022-09-20 16:22

If you have any answers or tips


© 2022 pinfo. All rights reserved.