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

Memory that can be used in a 16-bit computer, What is the maximum size of t...

What is the maximum size of the memory that can be used in a 16-bit computer and 32 bit computer? The maximum size of the memory that can be used in a 16-bit computer is 2 memo

Develop a regular expression for integer and identifier, Develop a regular ...

Develop a regular expression for Integer and Identifier (i) A regular expression for integer is [+ | -] (d)+ (ii) A regular expression for identifier is l(l | d)*

Decision tree learning, Decision Tree Learning: Furthermore there is s...

Decision Tree Learning: Furthermore there is specified in the last lecture such as the representation scheme we choose to represent our learned solutions and the way that we l

What is jmx architecture, JMX is based on a 3-level architecture:   ?...

JMX is based on a 3-level architecture:   ? The Probe level have the probes (known as MBeans) instrumenting the resources. Also known as the Instrumentation level. ? The A

What is the difference among save and save as, Use SAVE when you are revisi...

Use SAVE when you are revising an existing document. Use SAVE AS when you are making a new document from scratch or an existing document. This will remain the original document

#titlesoftware interface.., draw circuit diagram and the truth table that r...

draw circuit diagram and the truth table that represent demultiplexer

What is a system call, What is a system call? A  system  call  is  a  r...

What is a system call? A  system  call  is  a  request  made  through  any  program  to  the  operating  system  for performing tasks, picked by a predefined set, that the said

What are the basic features of supply chain management, What are the basic ...

What are the basic features of Supply Chain Management? Features of Supply Chain Management Supply Chain Management uses different methods to find out, affect and chang

Give an example of shortest job next scheduling, Consider the following set...

Consider the following set of jobs with their arrival  times, execution time (in minutes), and deadlines. Job Ids Ar r ival Time E xecuti

Validate the xml document , As an XML expert you are needed to model a syst...

As an XML expert you are needed to model a system for an online furniture shop. After an interview with the shop manager you have the certain information: The detail of th

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