🔒 Closed Sino po may alam nito

Status
Not open for further replies.

If Else

Established
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.

About this Thread

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

Online now

Members online
1,039
Guests online
680
Total visitors
1,719

Forum statistics

Threads
2,276,962
Posts
28,973,362
Members
1,229,667
Latest member
Kismut26
Back
Top