0% found this document useful (0 votes)
59 views

Code2flow 094e9

The document defines an integer array num with 10 elements to store user-input numbers. It then prints a menu and prompts the user to select an option: 1) display min and max numbers, 2) display total, 3) display evens, 4) display odds. Based on the option, it either prompts the user to input 10 numbers, calculates the total, or prints the even/odd numbers entered. The program uses loops and conditional statements like if-else to process and display the selected output.

Uploaded by

pimfjif
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views

Code2flow 094e9

The document defines an integer array num with 10 elements to store user-input numbers. It then prints a menu and prompts the user to select an option: 1) display min and max numbers, 2) display total, 3) display evens, 4) display odds. Based on the option, it either prompts the user to input 10 numbers, calculates the total, or prints the even/odd numbers entered. The program uses loops and conditional statements like if-else to process and display the selected output.

Uploaded by

pimfjif
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

int main()

int num[10], index

int option, total, temp

total = 0

printf("Menu\n1. Display greater and smaller numbers.\n2. Display total of all numbers.\n3. Display any even numbers.\n4. Display any odd numbers.\n\nChoose a number :")

scanf_s("%d", &option)

printf("\n")

index = 0

index < 10

False True

printf("\n") printf("Enter integer num[%d] : ", index+1)

option == 2 scanf_s("%d", &num[index])

True False

int count = 0 option == 3 index++

True False

index = 0 option == 4

True

count < 10 index = 0

True False

total = total + num index < 10 False

count True printf("Total of all numbers : %d", total)

count++ (num[index] % 2) == 0 False index < 10

True False True

printf("This is even number that you enter = %d\n", num[index]) False 0 (num[index] % 2) != 0

True

index++ printf("This is odd number that you enter = %d\n", num[index]) False

index++

You might also like