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

Similar threads

About this Thread

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

Trending Topics

Online now

Members online
817
Guests online
2,646
Total visitors
3,463

Forum statistics

Threads
2,308,067
Posts
29,182,932
Members
1,191,814
Latest member
ajcruz01
Back
Top