Skip to content

Fatima-progmmer/If-else-if-condition-in-C-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

If-Else-If Condition in C

This repository contains a C program demonstrating the if-else-if conditional statement. The if-else-if ladder is used when multiple conditions need to be checked sequentially.

Program Overview

  • The program takes user input.
  • It evaluates conditions using the if-else-if statement.
  • It prints different outputs based on the given conditions.

How to Run

  1. Clone this repository:
    git clone https://github.com/Fatima-progmmer/If-else-if-condition-in-C.git
  2. Navigate to the directory:
    cd If-else-if-condition-in-C
  3. Compile the program:
    gcc program.c -o program
  4. Run the executable:
    ./program

Explanation

  • if (num > 0) → Executes if the number is positive.
  • else if (num < 0) → Executes if the number is negative.
  • else → Executes when the number is zero.

Contributing

Feel free to fork this repository and contribute improvements!

License

This project is open-source and free to use.


About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages