Tuesday, 4 October 2016

To check whether a no. is +ve or -ve

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a;
cout<<“enter the value a “;
cin>>a;
if(a>0)
{
cout<<“a is +ve”;
}
else
{
cout<<“a is -ve”;
}
getch();
}

No comments:

Post a Comment

Basic Implementation of Array as a Pointer

#include<iostream.h> #include<conio.h> void main() { clrscr();   int arr[5];   cout<<"Enter 5 nos. ";   f...