Computer Science, asked by margharettom2000, 3 days ago

DAF To input any ten numbers and find the highest number​

Answers

Answered by adityawaghamode100
2

Answer:

#include <stdio.h>

int main() {

int a[10];

int i;

int greatest;

printf("Enter ten values:");

//Store 10 numbers in an array

for (i = 0; i < 10; i++) {

scanf("%d", &a[i]);

}

//Assume that a[0] is greatest

greatest = a[0];

for (i = 0; i < 10; i++) {

if (a[i] > greatest) {

greatest = a[i];

}

}

printf("

Greatest of ten numbers is %d", greatest);

return 0;

}

Similar questions