1. Write a Program to Take input from user Print maximum value of two number c program .
2. write a Program To take input from user print number is number is Positive , Negative or Zero program c program .
1.
Write a Program to Take input from user Print maximum value of two number c program - Program Code .
/* Write a program to take input from
user print maximum value of two number */
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter the value of a :");
scanf("%d",&a);
printf("Enter the value of b :");
scanf("%d",&b);
if(a>b)
printf("%d is Maximum",a);
else if(a==b)
printf("Two Number are Equal");
else
printf("%d is Maximum",b);
getch();
}
PROGRAM :-
OUTPUT :-
Download Program source code
2.
write a Program To take input from user print number is number is Positive , Negative or Zero program c program - Program code .
/* Write a Program to take input from
user print number is Positive,Negative or Zero */
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("Enter the number :");
scanf("%d",&n);
if(n>0)
printf("Number is Positive");
else if(n<0)
printf("Number is Negative");
else
printf("Number is Zero");
getch();
}
0 Comments
If You have any query, Please let me know..