7. Write a C program that prompts the User to initialize an array by providing its length, and its values. It then asks him to enter the ‘focal number’. Your task is to print all the values in the array that are greater than the ‘focal number’.

PHOTO EMBED

Sat Jul 22 2023 17:49:48 GMT+0000 (Coordinated Universal Time)

Saved by @Codes

// Online C compiler to run C program online
#include <stdio.h>

int main() {
    printf("Enter the size of the array: ");
    int size;
    scanf("%d", &size);
    int points[size];
    int focalnumber;
    printf("Enter the focal number: ");
    scanf("%d", &focalnumber);
    for(int i = 0; i < size; i++){
        printf("\nElement - %d: ", i+1);
        scanf("%d", &points[i]);
        
    
    }
    for(int i = 0; i < size; i++){
    if(points[i]>focalnumber){
        printf("%d ", points[i]);
        points[i]++;
        
    }
 } 

    return 0;
}
content_copyCOPY