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

How 2-domain name servers contain exactly same set of names, Does it makes ...

Does it makes sense for two domain name servers to contain exactly the same set of names? Why? Yes. This is very advantageous for two domain servers having similar set of names

Explain asynchronous decade counter, Draw the circuit diagram of Asynchrono...

Draw the circuit diagram of Asynchronous decade counter and explain its working. Ans: To  design  a  circuit diagram of decade  asynchronous  counter  initially  we  dr

System analysis and design, write an algorithm on railway reservation ticke...

write an algorithm on railway reservation ticket window

Define flash memory, Define Flash Memory. It is an approach same to EEP...

Define Flash Memory. It is an approach same to EEPROM technology. A flash cell is based on a one transistor controlled by trapped charge just like an EEPROM cell.

Explain the resolution of an ADC, Explain the Resolution of an ADC. ...

Explain the Resolution of an ADC. Ans. Resolution- It  is  the  smallest  possible  change  in  input  voltage  the same as  the  fraction  of percentage of the full s

What is combinational circuits, Q. What is Combinational circuits? Comb...

Q. What is Combinational circuits? Combinational circuits are interconnected circuits of gates according to definite rules to generate an output relying on its input value. A w

Determine condition how the output changed of JK flipflop, The output of a ...

The output of a JK flipflop with asynchronous preset and clear inputs is '1'. The output can be changed to '0' with which conditions ? Ans. Through applying J = 1, K = 1 and u

Define edge triggered d flip flop, Define Edge Triggered D flip-flop? D...

Define Edge Triggered D flip-flop? D latch has only two inputs C(control) and D(data). The operation of a D flip-flop is a lot simpler and it has only one input addition to the

Why we need the need of parallel computation, THE NEED OF PARALLEL COMPUTAT...

THE NEED OF PARALLEL COMPUTATION   With the growth of computer science, computational pace of the processors has also increased many a times. Though, there are definite constr

How many octets does smallest possible ipv6 datagram contain, How many Octe...

How many Octets does the smallest possible IPV6 datagram contain? The maximum size of an Ipv6 datagram is 65575 bytes, with the 0 bytes Ipv6 header. Ipv6 also describe a minim

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