30.12.20

c program to check the given is positive or negative number

#include<stdio.h>

int main()

{

 int a;

printf("Enter a number");

scanf("%d",&a);

if(a>0)

{

printf("Positive number");

}

else 

{

printf("Negative numbers");

}

return 0;

}

OUTPUT

Enter a number -10

Negative number 

No comments:

Post a Comment

JAVA program pattern 2

import java.util.Scanner; public class pattern3 { public static void main(String args[]) { int i,j; Scanner sc=new Scanner(System.in); Syste...