---
title: "What is if-else condition in programming language?"  
description: "What is if-else condition in programming language?"  
author: "Mukul Goenka"  
published: 2021-11-07  
updated: 2021-11-07  
canonical: https://www.mindstick.com/forum/156803/what-is-if-else-condition-in-programming-language  
category: "c#"  
tags: ["c#", ".net", "java"]  
reading_time: 1 minute  

---

# What is if-else condition in programming language?

What is if-else [condition](https://www.mindstick.com/forum/12711/select-query-with-and-condition) in [programming language](https://www.mindstick.com/articles/329035/5-most-in-demand-programming-languages-to-consider-for-your-app-development-in-2022)?

## Replies

### Reply by Ravi Vishwakarma

If-else statement, All programmers are familier with if-else statement.

In C if-else statement is used to perform operations based on your specific condition. The specified operation in the block is executed if and only if the given condition is true and condition is false then control goes to else part.

**Syntax.**

```
if(expression){
//code to be executed  at true condition}  else{//code to be executed at false condition}
```

## Program

```
#include<stdio.h>
int main(){
int number=0;
printf('Enter a number:');
scanf('%d',&number);
if(number%2==0){
printf('%d is even number',number);
}else{printf('%d is odd number',number);}return 0;
}   
```

## Output:

```
Enter a number: 55 is even number
```

\


---

Original Source: https://www.mindstick.com/forum/156803/what-is-if-else-condition-in-programming-language

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
