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

Develop a plan to apply theory of constraints, 1. The Goal: Do you think th...

1. The Goal: Do you think that this is an operational methodology or a philosophy? Please explain. 2. How to apply Constraint Management to a Production Facility? How about to a

Explain optimal page replacement algorithm, Optimal Page Replacement Algori...

Optimal Page Replacement Algorithm The optimal page replacement algorithm that as well known as OPT is an algorithm which works as follows: while a page needs to be swapped in,

Inventor, I am the inventor of the railway signaling device now operated by...

I am the inventor of the railway signaling device now operated by timer. I wish to move on to the next phase where the equipment will be operated by DTMF codes. The device is a si

Explain physical characteristics of magnetic disk, Q. Explain Physical Char...

Q. Explain Physical Characteristics of magnetic disk? Figure below lists main features that differentiate among different types of magnetic disks. First head may either be fixe

What is flag, Flag is a flip-flop used to kept the information about the st...

Flag is a flip-flop used to kept the information about the status of a processor and the status of the instruction implemented most recently A software or hardware mark that si

Loogen, i need u to write my exam for $10,000

i need u to write my exam for $10,000

Functioning of registers, Functioning of registers: at any instance of time...

Functioning of registers: at any instance of time global registers and only one window of registers is visible and is addressable as if it were only set of registers. So for progra

Program, Write a program to find the area under the curve y = f(x) between ...

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

Explain binary number system, Explain Binary number system. Ans. Bi...

Explain Binary number system. Ans. Binary Number System The number of system along with base or Radix two is termed as the Binary Number System. To show the number, 0 a

Explain the fundamentals of c programming, Explain the Fundamentals of C Pr...

Explain the Fundamentals of C Programming? The C is a general purpose structured programming language. The C was developed and first implemented by the Dennis Ritchie at Bell L

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