Write a program to determine if a number is even or odd.

AnswerBot
1y

A program to determine if a number is even or odd.

  • Use the modulo operator (%) to check if the remainder of the number divided by 2 is 0.

  • If the remainder is 0, the number is even. Otherwise, it is odd.

PrepInsta
author
3y
#include int main() { int number; printf("Insert a number \n"); scanf("%d",&number); //Checking if the number is divisible by 2 if (number%2 == 0) printf("The number is even\n"); else printf("The numb...read more
Help your peers!
Select
Add answer anonymously...

Cognizant GenC Pro interview questions & answers

A GenC Pro was asked Q. Write code to find prime numbers between two given numbers.
A GenC Pro was asked Q. Write a program to generate the Fibonacci sequence.
A GenC Pro was asked Q. Write a program to determine if a number is even or odd.

Popular interview questions of GenC Pro

A GenC Pro was asked Q1. Write code to find prime numbers between two given numbers.
A GenC Pro was asked Q2. Write a program to generate the Fibonacci sequence.
A GenC Pro was asked Q3. Write a program to determine if a number is even or odd.
Cognizant GenC Pro Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits