C++ program to check the given number is positive or negative
kw.cpp
#include<iostream>usingnamespacestd;intmain(){intn;cout<<"Enter a number ";cin>>n;if(n<0){cout<<"Entered number is negative"<<endl;}elseif(n>0){cout<<"Entered number is positive"<<endl;}else{cout<<"Entered number is zero"<<endl;}return0;}
Output
kodingwindow@kw:~$ g++ kw.cpp kodingwindow@kw:~$ ./a.out
Enter a number -3.14
Entered number is negative
kodingwindow@kw:~$ ./a.out
Enter a number 0
Entered number is zero
kodingwindow@kw:~$
Dear User, Thank you for visitng Kodingwindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.
Dear User, We are grateful for your interest in the Kodingwindow Android app. We intend to soon make it available on the Google Play Store. Currently, Android versions 10 and up require manual apk installations. Would you like to get the app?