Dude, your fucking programming! LAB2Q4

LAB2Q4

 

 

#include <stdio.h>

void main(){

//variables

int luckyNumbers[10];
int sumTotal = 0;
int maxNum = 0;
int minNum = 0 ;

printf(“Please enter 10 of your lucky numbers…:\n”);

for(int mattDamon = 0; mattDamon < 10; mattDamon++){

printf(“Please enter number … %d :”, mattDamon +1);
scanf(“%d”, &luckyNumbers[mattDamon]);
sumTotal += luckyNumbers[mattDamon];

}//

maxNum = luckyNumbers[0];
minNum = luckyNumbers[0];

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

if(maxNum < luckyNumbers[i]){

maxNum = luckyNumbers[i];

}

if (minNum > luckyNumbers[i]){

minNum = luckyNumbers[i];

}

}//end of 2nd for loop

printf(“\nThe min Number is …: %d”, minNum);
printf(“\nThe max number is … %d”, maxNum);
printf(“\nThe sum total is …%d”, sumTotal);

}//end bracket

Leave a Reply

Your email address will not be published. Required fields are marked *