#include<stdio.h>
main()
{
int num;
printf("Enter any Number To Check It is Positive or Negative:\n");
scanf("%d",&num);
switch(num>0)
{
case 1:
printf("%d is positive number",num);
break;
case 0:
switch(num<0)
{
case 1:
printf("%d is negative number",num);
break;
case 0:
printf("%d is zero",num);
break;
}
break;
}
return 0;
}
Wednesday, June 13, 2018
Check Whether The Number Is Positive, Negative Or Zero With Switch Statement
C Programs- Switch Case
Labels:
C Programs,
C Programs- Switch Case
Subscribe to:
Post Comments (Atom)
No comments: