Tech Study

C++ program to check number is positive, negative or zero

Introduction

C++ program to check number is positive, negative or zero. I have used DEV-C++ compiler for debugging purpose. But you can use any C programming language compiler as per your availability.

#include<iostream>
using namespace std;

int main()
{
    char ch;

    cout<<"Enter any character: ";
    cin>> ch;

    cout << "It is " <<(((ch>='a' && ch<='z') || (ch>='A' && ch<='Z')) ? "albhabet" : "not albhabet");

    return 0;
}

Result

C++ program to check number is positive, negative or zero
C++ program to check number is positive, negative or zero

To learn more about c++ viste these links ;

Write C++ program to print all natural numbers in reverse order

Write C++ program to check even or odd number using switch case

Write C++ program to check prime and armstrong numbers using function

TaggedC program to check number is positivenegative or zero

Python Examples

Introduction: Python Examples are the basic programming concepts of python like python syntax,python data types,,python operators,python if else,python comments etc.. …

Read more

C String Functions

C String Functions perform certain operations, It provides many useful string functions which can come into action. The <string.h> header …

Read more