Skip to content
Menu
Code for Java c
  • Home
  • Java
    • Java Examples
    • Java tutorials
  • C
    • C tutorials
    • C Examples
  • C++
    • C++ Tutorials
    • C++ Examples
  • Python
    • Python Tutorials
    • Python Examples
  • About
    • About me
    • contact us
    • disclaimer
    • Privacy Policy
Code for Java c

Nested if in C++ Programming Language

Posted on October 1, 2017September 28, 2020

Table of Contents

  • Nested if in C++ programming Language
    • Syntex
    • Flow diagram

Nested if in C++ programming Language

In this tutorial, we will discuss the Nested if in C++ language

In C++, use of if statement in another if block or another else block is known as nesting if. So, it can be used in more than one if block in one program.

Syntex

Nested if in C++ Programming Language
Syntax

 

Flow diagram

"<yoastmark

In the above diagram, first,The outer-if statements evaluates the test expression(boolean expression)

When the test expression is evaluated to true codes inside the body of outer-if is executed and the statements inside the body of outer-else are skipped

Then the control moves to inner-if to check test expression

When the test expression is evaluated to true codes inside the body of inner-if is executed and body of inner-else are skipped

when the test expression is evaluated to false inside the body of inner if is skipped and inside the body of inner-else are executed

 

Example 1

Nested if in C++ Programming Language
Example

 

When we executed the above program, it produced the following result

your marks is enougn
you can enter university

Program 2

Nested if in C++ Programming Language
Example

 

When we executed the above program, it produced the following result

you are pass

Similar post

If statement in C++ language

If statements in Java language

If statements in Python programming

If statement in C language

Related

Recent Posts

  • Subtract two numbers using method overriding
  • PHP Star triangle Pattern program
  • Using function or method to Write temperature conversion : Fahrenheit into Celsius
  • Function or method:temperature conversion from Fahrenheit into Celsius – Entered by user
  • Write temperature conversion program: Fahrenheit into Celsius
  • How to write a program to convert Fahrenheit into Celsius

tag

Addition (6) Array (38) C++ language (91) C language (98) c sharp (23) Division (6) Function (29) if else (32) Java language (102) JavaScript (5) loops (137) Multiply (7) Oop (2) patterns (65) PHP (13) Python Language (38) Subtraction (7) temperature (20)

Archives

Categories

Address

Global information technology

Puloly south, PointPedro

Jaffna

Srilanka

©2025 Code for Java c | Powered by SuperbThemes