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 is the command suppress-dialog useful, How is the command Suppress-Dial...

How is the command Suppress-Dialog useful? Suppressing whole screens is possible using this command.  This command permits us to perform screen processing "in the background".

Find minimal expression for sop, Consider the following expression. Assume ...

Consider the following expression. Assume that complement inputs are available. F(A,B,C,D) = ∑m (0,1,3,5,9,12,14) + ∑d (4,10,15) 1. Find minimal expression for SOP. Draw gate ne

Can you explain about internet protocol, Q. Can you explain about Internet ...

Q. Can you explain about Internet Protocol? Internet protocol specifies the rules which define the details of how computers communicate. It specifies exactly how a packet shoul

Explain the acceptance and request determination, Explain the Acceptance an...

Explain the Acceptance and Request Determination As we have learned, much of the overhead in client-server interaction occurs in the CSInteface, either client or server. It is

Explain non-pre-emptive algorithms, Explain non-pre-emptive algorithms?   ...

Explain non-pre-emptive algorithms?   Non preemptive algorithms: In this algorithm a job is provided to CPU for execution as long as the job is non-completed the CPU cannot

Advantages on electronic payment system, Advantages on electronic payment s...

Advantages on electronic payment system It gives good security schemes.  Four necessary security requirements for safe e-payments are Authentication, Encryption, Integrity,

Determine the bandwidth required for transmission, A PCM system uses 8 bits...

A PCM system uses 8 bits per sample and the analog signal is limited to 4.3 kHz. The PCM data is transmitted using (a) BFSK and (b) ASK. Determine the bandwidth required for transm

What is ai checkers, The major programs here are Arthur Samuel's, the rote ...

The major programs here are Arthur Samuel's, the rote learning method which is a lot like a memory based method, generalization learning which is a lot like backprop and a signatur

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

What is interpreter, What is interpreter? An  interpreter is a program ...

What is interpreter? An  interpreter is a program that appears to execute a source program as if it were machine language.

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