Enter your email id to get regular update free
Login
Your Email
Pasword

Branching in #C : concept of If-else and their uses in programs (part 2) (module-19)

In this section we will discuss on the important topic of C. The control statements and its many applications in writing a program using the concepts of loops and branching. Different types of branching like if statement, if-else statements, nested if else statements etc.

This is the 19th module on learning C with us. Earlier we discussed on the basic introduction and structure of C, preprocessor it's features, intermediate and executable codes. compilation and execution process of a C program. And keywords and identifiers, data types, variables and constants, scope of variables, operators and expressions in C. Type casting in #C. Introduction to input and output functions and reading a character in #C. Unformatted and formatted input functions. 
In this section we will discuss on the most important topic of C that is branching. different types of branching like if statement, if-else statements, nested if else statements etc.
For part-1 and part-3 on if and nested if-else structure you may refer here :-
Part-1 if
Part-3 nested if-else 
If-else statements :- 

format : 
   if(condition)        
              { statement 1; }                 
   else                   
            { statement 2; }   
In the above if-else statement the condition  compares first, if it is true then statement 1 will executes, if the specified condition is false then the statement 2 is else part will executes. 
Example :     
main()                     
{ int num;                       
  printf("enter one value");    
  scanf("%d",&num); 
  if(num%2==0)  
        printf(" number is even");                       else                             
         printf(" number is odd");    
}
In next module we will continue our discussions on the next topic on nested if-else structure. For more information regarding #C please be updated with us only on Www.newsandstory as we provide all the information on all the topics covered in #C.
Conditional sentence
if
if-else
nested if-else
statement
structure
Programming
#c
coding
learning
technology
Dalpat I
Content writer
Total 95 views