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

Writing down your own interrupt service routines, Q. Writing down your own ...

Q. Writing down your own Interrupt Service Routines? Here are a few rules which should be kept in mind while writing down your own Interrupt Service Routines: 1.  Use Int 21

Define the state and instance of properties of object, Define the state and...

Define the state and instance of properties of object A state encompasses all properties of object along with values of each of these properties. An instance is a concr

What is class invariant in c++, A class invariant is a condition that descr...

A class invariant is a condition that describes all valid states for an object. It is a logical condition to make sure the correct working of a class. Class invariants must hold wh

Describe language processing activities, Describe language processing activ...

Describe language processing activities? There are two different kinds of language processing activities: a. Program generation activities b. Program execution activities

Address phase - computer architecture, Address phase: A PCI bus transa...

Address phase: A PCI bus transaction starts having an address phase. The initiator,  after seeing that it has GNT# and the bus is inactive, drives the target address onto the

Explain the accuracy of an ADC, Explain the Accuracy o f an ADC. Ans...

Explain the Accuracy o f an ADC. Ans Accuracy- The accuracy of D to A converter is the difference among actual output voltage and the expected output voltage in D to A c

Explain pre-emptive scheduling, Explain Pre-emptive scheduling? Pre-em...

Explain Pre-emptive scheduling? Pre-emptive scheduling: in its approach, center processing unit can be taken away from a process if there is a require while in a non-pre-empt

Main strength of ascii, Q. Main strength of ASCII? One such standard co...

Q. Main strength of ASCII? One such standard code which enables language encoding that is popularly used is ASCII (American Standard Code for Information Interchange). This cod

What are the types of smart cards utilized in e-commerce, What are the type...

What are the types of smart cards utilized in e-commerce? Usually, there are two types of smart cards as: Memory smart cards, that can be viewed by minuscule removable read

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