Professional Documents
Culture Documents
Index: Write A Program To Input Any No. and Find It Is Positive, Negative and Zero
Index: Write A Program To Input Any No. and Find It Is Positive, Negative and Zero
S.
Program
No
1. Write a program to input any no. And find it is positive
4
5
6
7
8
Sign
1.write a program to input any no. And find it is positive,negative and zero
********************************************************
#include<stdio.h>
#include<conio.h>
void main()
{
int a,i;
clrscr();
printf("enter the value of a==");
scanf("%d",&a);
if(a>0)
printf("no. is +ve");
else if(a<0)
printf("no. is -ve");
else
printf("zero");
getch();
}
OUTPUT:********************************************************
Enter the value of a == 10
No. 9 is +ve
OUTPUT:********************************************************
Enter the value of a no.==21
Enter the value of b no. ==31
a==31
b==21
OUTPUT:********************************************************
Enter the radius 10
Area=314
Cir=62.8
OUTPUT:********************************************************
Enter the value of p== 1000
Enter the value f r==10
Enter the value of t ==10
Si==1000
OUTPUT:********************************************************
Enter the value of a==5
Odd
Enter the value of a== 6
even
OUTPUT:********************************************************
Enter the value of a==12
Enter the value of b==15
B is greater
OUTPUT:********************************************************
Enter the values of a==153
armstrong
OUTPUT:********************************************************
Enter any year value 2012
This is leap year
OUTPUT:********************************************************
Enter the marks of five subject=
65
63
64
66
64
first
OUTPUT:********************************************************
2
4
6
8
10
12
14
16
18
20
OUTPUT:********************************************************
Enter the no.==123
Sum ==6
OUTPUT:********************************************************
Enter any number 12
Square==144
OUTPUT:********************************************************
Enter the no.== 5
The factorial of given number =120
OUTPUT:********************************************************
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
OUTPUT:********************************************************
1
2
3
5
7
OUTPUT:********************************************************
1
2
3
4
5
6
7
8
9
10