S Sakurara Eternal Poster Established Joined Nov 24, 2016 Posts 575 Reaction 104 Points 390 Oct 13, 2021 #1 Create a C program that will determine the even numbers below is the sample output. Enter a number: 4 4 is even number
Create a C program that will determine the even numbers below is the sample output. Enter a number: 4 4 is even number
A Arcturus 𝙻𝚊𝚣𝚢 𝙳𝚎𝚟 Contributor Oct 13, 2021 #2 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");
C cloverly Honorary Poster Oct 13, 2021 #3 another solution is C: if (input&1) printf("Odd"); else printf("Even");
S Sakurara Eternal Poster Established Oct 13, 2021 TS TS #4 Arcturus said: Conditional operator lang po ito ts, magbasa kalang kahit konti lang magegets mo yan. input % 2 == 0 printf("Even"); else printf("Odd"); Click to expand... #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; }
Arcturus said: Conditional operator lang po ito ts, magbasa kalang kahit konti lang magegets mo yan. input % 2 == 0 printf("Even"); else printf("Odd"); Click to expand... #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; }
S Sakurara Eternal Poster Established Oct 13, 2021 TS TS #5 Ta Jerson Villaceran said: #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; } Click to expand... Tama ba ito ts
Ta Jerson Villaceran said: #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; } Click to expand... Tama ba ito ts
A Arcturus 𝙻𝚊𝚣𝚢 𝙳𝚎𝚟 Contributor Oct 13, 2021 #6 Jerson Villaceran said: Ta Tama ba ito ts Click to expand... C: if(num % 2 == 0) printf("Even"); else printf ("Odd");
Jerson Villaceran said: Ta Tama ba ito ts Click to expand... C: if(num % 2 == 0) printf("Even"); else printf ("Odd");