判斷敘述式
1. notebook 2.影片栽要 3.測驗 4. 學習卡 5.115103138%5+1 Square Numbers Ending in 5 📌 Problem Description Write a program to calculate the square of a number only if its least significant digit (the last digit) is 5 . If the number ends in 5 , the program calculates and displays its square. Otherwise, the program informs the user that the number does not end in 5 . 💡 Example Example 1: Enter the number: 25 Square = 625 Example 2: Enter the number: 13 The number does not end in 5. 🧠 Algorithm Ask the user to enter an integer. Use the modulo operator ( % ) to check the last digit of the number. If number % 10 == 5 , calculate the square of the number. Display the result. Otherwise, display a message indicating that the number does not end in 5 . 💻 Source Code (C) #include <stdio.h> int main() { int number; printf("Enter the number: "); scanf("%d", &number); if (number % 10 == 5) { printf("Square = %d\n", number * number); ...