luc055.c (1131B)
1 /* 2 * Author : Amit Dutta <amitdutta4255@gmail.com> 3 * Date : 08 Feb 2026 4 * Repo : https://github.com/notamitgamer/bsc 5 * License : MIT License (See the LICENSE file for details) 6 */ 7 8 /* 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. 9 */ 10 11 /* Let Us C, Chap- 13 (Arrays), Qn No.: B(a) */ 12 13 /* This file is auto-generated by a bot. */ 14 /* This code is not compiled; it is for reference only. */ 15 16 17 #include <stdio.h> 18 #include <math.h> 19 #include <stdlib.h> 20 21 int main() 22 { 23 int arr[25], i; 24 int pos = 0, neg = 0, even = 0, odd = 0; 25 26 printf("Enter 25 integers:\n"); 27 for (i = 0; i < 25; i++) 28 { 29 scanf("%d", &arr[i]); 30 31 if (arr[i] > 0) 32 pos++; 33 else if (arr[i] < 0) 34 neg++; 35 36 if (arr[i] % 2 == 0) 37 even++; 38 else 39 odd++; 40 } 41 42 printf("\nResults:\n"); 43 printf("Positive: %d\n", pos); 44 printf("Negative: %d\n", neg); 45 printf("Even: %d\n", even); 46 printf("Odd: %d\n", odd); 47 48 return 0; 49 }