Question: Write a C program that prompts the user to enter N integers and checks whether there exist three consecutive odd integers. Accordingly, your program should:
Write a C program that prompts the user to enter N integers and checks whether there exist three consecutive odd integers. Accordingly, your program should:
Prompt the user to enter N the number of integers in the list greater than three and less than
Prompt the user to enter the N integers and check if there exist three consecutive odd integers.
After the user enters the N integers, your program should display a message indicating whether there exist three consecutive odd integers as shown below.
In this problem, you are required to submit two solutions without using arrays and with arrays
Hint: For you need to keep record of the last three integers entered by the user. Accordingly, you need to track the number entered at iteration i the previous numbers entered i and i
Note: If you need to use variables of type bool you need to add #include
Sample inputoutput :
Please enter N the number of integers in the list:
Please enter the integers:
Three consecutive odd integers? NO
Sample inputoutput :
Please enter N the number of integers in the list:
Please enter the integers:
Three consecutive odd integers? YES
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
