Chapter:

C-Programs-on-integers

C Program to Check if a given Integer is Positive or Negative:

This is a C program to check whether a given integer is positive or negative.

Problem Description

The program takes the given integer and checks whether the integer is positive or negative.

Problem Solution

  • Take the integer which you want to check as input.

  • Check if it is greater or lesser than zero and print the output accordingly.

  • Exit.

Program/Source Code

#include <stdio.h>

 

void main()

{

    int number;

 

    printf("Enter a number \n");

    scanf("%d", &number);

    if (number >= 0)

     &....

Show More

All Chapters

View all Chapter and number of question available From each chapter from C-programming-