Command Line Program for Odd Even

C Programming Language / Command Line Arguments

747

Program:

#include <stdio.h>

int main(int argc, char *argv[])

{

int number;

number = atol(argv[1]);

if(number % 2 == 0)

printf("%d is even.", number);

else

printf("%d is odd.", number);

return 0;

}

Output:

12

12 is even

Explanation:

Nope

This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.