Friday, March 17, 2023

"find a number positive or negative using if-else statement " in c

 //find a number  positive or negative using if-else statement

#include <stdio.h>
int main (){
    int num;
    printf ("Enter the number :");
    scanf ("%i",&num);
    if (num>0){
        printf ("%i is the positive number ",num);
    }
    else if(num<0) {
        printf ("%i is the negative number ",num);}
else {
    printf ("0 is the neither positive nor negative ");
}
return 0;

}


No comments:

Post a Comment

print a multiplication table of any integer taking from user

 // print a multiplication table of any integer taking from user  #include "stdio.h" int main () { int n,mul,i; printf ("...