This program takes a number as input from the user, uses modulo arithmetic to check if the number is even or odd, and prints out whether the number is even or odd based on the result of the modulo operation. It prompts the user to enter a value for n, uses the modulo operator (%) to check if n is evenly divisible by 2, and prints a message indicating whether the input number is even or odd.
This program takes a number as input from the user, uses modulo arithmetic to check if the number is even or odd, and prints out whether the number is even or odd based on the result of the modulo operation. It prompts the user to enter a value for n, uses the modulo operator (%) to check if n is evenly divisible by 2, and prints a message indicating whether the input number is even or odd.
This program takes a number as input from the user, uses modulo arithmetic to check if the number is even or odd, and prints out whether the number is even or odd based on the result of the modulo operation. It prompts the user to enter a value for n, uses the modulo operator (%) to check if n is evenly divisible by 2, and prints a message indicating whether the input number is even or odd.
read n a = `expr $n % 2` if [ $a -eq 0 ] then echo Given number $n is even else echo Given number $n is odd f
OUTPUT : [16eee77@localhost untitled folder]$ vi rizwana.sh [16eee77@localhost untitled folder]$ sh rizwana.sh enter any value for n : 3 Given number 3 is odd