C Program To Count Positive, Negative, Even And Odd Numbers In An Array

preview_player
Показать описание

Twenty-five numbers are entered from the keyboard into an array. Write a program to find out how many of them are positive, how many are negative, how many are even and how many odd.

Important Note
Most of the time 0 is considered as even number, as it has odd numbers on either side of it i.e., 1 and -1. And 0 is perfectly divisible by 2.

Also note that 0 is neither positive and nor negative.

C Programming Interview / Viva Q&A List

C Programming: Beginner To Advance To Expert

Join this channel to get access to perks:
Рекомендации по теме
Комментарии
Автор

Hello do you have a code for that but if you enter 1 single only number

Input : 1
Out put : 1 positive and even number. Like that?

Onii
Автор

Write a c++ Program to create a dynamic array has N = 7 elements. Get integer values into array and then provide the following functionality: a) Sort them in ascending/descending order. b) Print all even numbers available in the array. c) Print all Odd numbers available in the array. d) Print all prime numbers available in the array. e) Print all complete square numbers (e.g. 4, 9, 16, 25 etc.) available in the array. f) Change the size of an array from 7 to 15 dynamically. g) Insert elements on new locations and print all elements.

ziaullahkhan