answersLogoWhite

0


Best Answer

/*Programming in C...*/

#include


int main(void)
{

int n ;
printf("enter a number :");
scanf("%d",&n);

if(n%2==0)
{
printf("no is even\n");
}
else
printf("no. is odd\n");

return 0;
}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

echo -n "Enter numnber : " read n rem=$(( $n % 2 )) if [ $rem -eq 0 ] then echo "$n is even number" else echo "$n is odd number" fi

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a shell program to check odd or even number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a shell program to check and display 10 leap years?

dono


Write a Shell program to find the smallest number from a set of numbers?

k


Shell program for gcd of three given numbers?

write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? write a shell program for finding out gcd of three given numbers? check bellow link http://bashscript.blogspot.com/2009/08/gcd-of-more-than-two-numbers.html


Write a Shell program to find the sum of cube of individual digits of a number?

no thanks


Write a program in shell script to display odd number from 0 to 100?

seq 1 2 99


Write a shell programs for to check whether the given number is an Avogadro number or not?

Avogadro's number is a constant. Therefore only one number is equal to Avogadro's number.


Write a shell program to check read and write permissions of a file?

You don't say what you want to do with the permissions, but most shells have a 'test' command that can look at various permissions. Look at the 'man' command for the shell you are running in to see what tests are possible on files and directories. You can check to see if the target is a directory, or a file, and whether it has read, write, or execute/search permissions. Again, it varies by the shell environment.


Shell program to find the smallest digit of a given number?

syntax error


Write a shell program to delete all the files in the current directory?

in winxp del *.* /Q /S


Write a shell program called whos to display a sorted list of the logged in usersJust display the user names and no other information?

The 'users' command should do that; you don't need to write a shell script to get that information in that format.


Write a Shell program to find the area and circumference of a circle?

echo "Enter the Number" read n r=`expr $n % 2` if [ $r -eq 0 ] then echo "$n is Even number" else echo "$n is Odd number" fi


Write a shell program using if-the-else to test whether a variable name is a directory or a file?

see : Write_a_shell_program_using_the_if-the-else_to_test_whether_a_variable_name_is_a_directory_or_a_file