Give the syntax of if-else statement, Computer Engineering

Assignment Help:

Give the syntax of "if-else" and "switch" statements and explain.

if else

This is used to decide whether to do something at a special point, or to decide between two courses of action.

Syntax of  if else

if (conditional expression) Statement1;

else

Statement2;

The following test decides whether a student has passed an exam with a pass mark of 45 if (result >= 45)

printf("Pass\n");

else

printf("Fail\n");

It is possible to use the if part without the else.

 

 


Related Discussions:- Give the syntax of if-else statement

Participate in grid computing, Different systems that can participate in gr...

Different systems that can participate in grid computing as platform are:  Windows 3.1, 95/98, NT, 2000 XP , DOS, OS/2, , supported by  Intel ( x86); Mac OS  A/UX (Unix)  sup

Numbers square, Your professor wants you to fill a two-dimensional N by N m...

Your professor wants you to fill a two-dimensional N by N matrix with some numbers by following a specific pattern. According to his explanation as in the figure below, you have to

Find 9''s complement for decimal number, Q. Find 9's complement for decimal...

Q. Find 9's complement for decimal number? The 9's complement is achieved by subtracting every digit of number from 9 (the highest digit value). Let's assume that we want to si

Is it possible to decrease clock skew to zero, Is it possible to decrease c...

Is it possible to decrease clock skew to zero? Describe your answer? Even if there are clock layout strategies (H-tree) which can into theory reduce clock skew to zero by havi

Software, its language base assignment

its language base assignment

What are the types of assemblies, There are two types of assemblies:- 1...

There are two types of assemblies:- 1. Private Assemblies 2. Shared Assemblies

Determine through which symbolic names can be associated, Determine Symboli...

Determine Symbolic names can be associated with Symbolic names can be associated with the data or instruction

Determine the hardware for multiplication, Determine the hardware for multi...

Determine the hardware for multiplication The hardware for multiplication consists of equipment given in Figure. The multiplier is stored in register and its sign in Q . The se

Communication traffic and message queues, The Communication Traffic gives a...

The Communication Traffic gives a pictorial view of the communication traffic in the interconnection network with respect to the time in progress. The Communication Traffic shows t

Programming in c, Write a program to find the area under the curve y = f(x)...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd