Knowledge Walls
Venkatesan
Hyderabad, Andhra Pradesh, India
Passcode:
Introduction [cont'd]
Input Output Functions [cont'd]
Structures and Unions [cont'd]
# Preprocessor [cont'd]
If-Without Curly braces in Decision Statements of Programming in C
1542 Views
Hint 
If you given single statement as IF block statement then curly braces not needed.
IF example
#include
//To check given no is even number
void main(){
    int num;
    printf("Enter a number to check given number is even\n");
    scanf("%d",&num);
    if ((num % 2) == 0)
    printf("Given Number is even:%d",num);
}
Output 
Enter a number to check given number is even
46

Given Number is even:46
Next Topics
Next lessons of current book.
Decision Statements of Programming in C
Decision Statements of Programming in C
Decision Statements of Programming in C
Decision Statements of Programming in C
Decision Statements of Programming in C
Previous Topics
Previous lessons of current book.
Input Output Functions of Programming in C
Input Output Functions of Programming in C
Input Output Functions of Programming in C
Input Output Functions of Programming in C
Input Output Functions of Programming in C
Best Lessons of "Programming in C"
Top lessons which are viewed more times.
Structures and Unions of Programming in C
Input Output Functions of Programming in C
Structures and Unions of Programming in C
Sub Lessons
If
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details