C Programming: If Else

更新 發佈閱讀 1 分鐘

Exercise 1: Even or odd

Prompt the user to enter an integer. Determine whether a given number is even or odd


Exercise 2: Grading System

Write a program that takes a student's score as input and prints their corresponding grade based on the following grading scale:

90 and above: A

80 - 89: B

70 - 79: C

60 - 69: D

Below 60: F


Exercise 3: Calculator Program

Write a simple calculator program that takes two numbers and an operator (+, -, *, /) as input and performs the corresponding arithmetic operation.


Code Examples:


留言
avatar-img
邵的沙龍
3會員
5內容數
邵的沙龍的其他內容
2023/08/27
C Programming: If-Else, For Loop Exercises
2023/08/27
C Programming: If-Else, For Loop Exercises
2023/08/26
C program: For Loop
2023/08/26
C program: For Loop
2023/08/26
C programming : Switch
2023/08/26
C programming : Switch
看更多
你可能也想看
Thumbnail
vocus 慶祝推出 App,舉辦 2026 全站慶。推出精選內容與數位商品折扣,訂單免費與紅包抽獎、新註冊會員專屬活動、Boba Boost 贊助抽紅包,以及全站徵文,並邀請你一起來回顧過去的一年, vocus 與創作者共同留下了哪些精彩創作。
Thumbnail
vocus 慶祝推出 App,舉辦 2026 全站慶。推出精選內容與數位商品折扣,訂單免費與紅包抽獎、新註冊會員專屬活動、Boba Boost 贊助抽紅包,以及全站徵文,並邀請你一起來回顧過去的一年, vocus 與創作者共同留下了哪些精彩創作。
追蹤感興趣的內容從 Google News 追蹤更多 vocus 的最新精選內容追蹤 Google News