Posts

Showing posts from November, 2019

Conditional Statements and Conditional Operator | C Weekly

Image
Welcome back, Today we are gonna talk about very interesting topic in programming - "Conditional Statements". As we know that a computer program is a set of statements, in previous blog discusses some types of statements in C. Now take a look on Conditional statements. Conditional Statements: Conditional statements are those statements which are based on some condition. For example you have some lines of code that you want to run only if a condition satisfy and you do not want that code to be run if the condition is not satisfy. But by default a C program execute in sequential manner that means one statement after another is execute as they were written. Consider the following example.         Statement 1;         Statement 2;         Statement 3;         Statement 4; First the compiler execute statement 1 then statement 2 and so on. If you put some condition for a block of statements the fl...