🔒 Closed Sino po may alam nito

Status
Not open for further replies.

If Else

Eternal Poster
Create a C program that will determine the even numbers below is the sample output.

Enter a number: 4
4 is even number
 
Conditional operator lang po ito ts, magbasa kalang kahit konti lang magegets mo yan.
input % 2 == 0
printf("Even");
else
printf("Odd");
 
Conditional operator lang po ito ts, magbasa kalang kahit konti lang magegets mo yan.
input % 2 == 0
printf("Even");
else
printf("Odd");
#include <stdio.h>
int main() {
int num;
printf("Enter an number: ");
scanf("%d", &num);

(num % 2 == 0) ? printf("%d is even.", num) : printf("%d is odd.", num);
return 0;
}
 
Status
Not open for further replies.

Similar threads

About this Thread

  • 5
    Replies
  • 423
    Views
  • 3
    Participants
Last reply from:
Arcturus

Trending Topics

Online now

Members online
1,159
Guests online
2,039
Total visitors
3,198

Forum statistics

Threads
2,288,595
Posts
29,052,704
Members
1,214,195
Latest member
Mali ski 0
Back
Top