answersLogoWhite

0


Best Answer

if(i != 5){

//do something

}

User Avatar

Wiki User

9y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

6y ago

if (i==5) {

// some code

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write an IF statement for executing some code if i is NOT equal to 5?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What does it mean to evaluate cobol?

The word evaluate in the programming language COBOL can be used to replace a nested if statement. Instead of long statement evaluate allows one to shorten the coding required and write cleaner code.


Compare break and continue statement?

Break - will force to terminate the loop you are in to the nearest outer block.Continue - will force to skip the rest of the code in loop and take next iteration.Break for example is not only limited to loop constructions, it is also used in switch statement in order to stop executing following cases (works as described above, jumps out of switch).


What to do if it says Missing before statement line 2 file Code?

If it says Missing before statement line 2 file Code you just need to include ; before the statement.


How do I write a program that lets me convert text to Morse code on Turbo Pascal 7.0?

There may be a more efficient method (I know very little about Morse code) but since there are only 26 letters you could use a giant if-else if statement.


Describe how you could obtain a statistical profile of the amount of time spent by a program executing different sections of its code?

One could issue periodic timer interrupts and monitor what instructions or what sections of code are currently executing when the interrupts are delivered. A statistical profile of which pieces of code were active should be consistent with the time spent by the program in different sections of its code. Once such a statistical profile has been obtained, the programmer could optimize those sections of code that are consuming more of the CPU resources.

Related questions

How do you write a conditional statement for executing some code if i is equal to 5?

The precise answer depends on the language that the algorithm is to be expressed in. Assuming the common 'C' family of languages, one would write: if(i==5){ [some code] }


How do you write a conditional statement for executing some code if i is NOT equal to 5?

It depends on the language. Each has different operators. First thing you learn with any language is which ones they use. some common operators include: i != 5 i <> 5


Can you write me a thesis statement on medical code and billing?

The new coding in the medical billing process.


How to use if statement programming in qlikview?

When using statement programming in qlikview you Open the QlikView application, Open Edit Script, Write code for the SET script statement, Save QlikView file, Sheet property Window, Select text object, Select text object, Write code of LET script statement, Sheet property Window and now you should see the LET statement.


Why is goto statement harmful?

It isn't. True, you can write bad code with goto, but you can do that without goto as well.


What does it mean to evaluate cobol?

The word evaluate in the programming language COBOL can be used to replace a nested if statement. Instead of long statement evaluate allows one to shorten the coding required and write cleaner code.


Compare break and continue statement?

Break - will force to terminate the loop you are in to the nearest outer block.Continue - will force to skip the rest of the code in loop and take next iteration.Break for example is not only limited to loop constructions, it is also used in switch statement in order to stop executing following cases (works as described above, jumps out of switch).


What works with one source statement at a time translating it to machine level instructions?

Are you asking about an "interpreter"? That's part of a computer language that reads a line of code and breaks it down into machine code. The Interpreter works with one source statement at a time, reading it, translating itto machine-level instructions, executing the resulting binary instructions, and then moving on to the next source statement. Almost no real interpreters generate any machine code, they simply interpret the source code and directly do what it says using machine code built into the interpreter when it was originally written. Machine code is generated by compilers, to permit repeated execution without having to reload the compiler each time (as one must with an interpreter).


What is the syntax of a conditional statement in JavaScript?

In JavaScript we have the following conditional statements:if statement - you would use this statement to execute some code only if a specified condition is trueif...else statement - you would use this statement to execute some code if the condition is true and another code if the condition is falseif...else if....else statement - you would use this statement to select one of many blocks of code to be executedswitch statement - you would use this statement to select one of many blocks of code to be executedFor example: If StatementUse the if statement to execute some code only if a specified condition is true. Syntaxif (condition) {code to be executed if condition is true}If...else StatementUse the if....else statement to execute some code if a condition is true and another code if the condition is not true. Syntaxif (condition) {code to be executed if condition is true}If...else if...else StatementUse the if....else if...else statement to select one of several blocks of code to be executed. Syntaxif (condition1) {code to be executed if condition1 is true}else if (condition2){code to be executed if condition2 is true}else{code to be executed if condition1 and condition2 are not true}else{code to be executed if condition is not true}


In Visual Basic 6.0 how do you write the calculations code for weeks days hours to equal total hours worked?

6 days and 9 hours equal how many hours?


What is bliss compiler?

A bliss compiler compiles Bliss source into Bliss object code which is a step in executing macdine code written by the Bliss compiler.


What is the difference between do while and while in C language?

WhileDo-While1. In this statement, the Boolean expression is checked before executing the loop body.1. In this statement, the Boolean expression is checked after executing the loop body for the first time.2. It doesn't execute its statement if the condition fails.2. It will execute its statements at least once even if the condition fails. After that if the condition founds false the execution stops.It is mainly used in menu like programs where all the available choices are printed at least once.3. General loop form iswhile (condition){statements}3. General loop form isdo{statements} while (condition)4. Executing a code at least once tend to be relatively rare, thus the simple while is more commonly used4. This used for a block of code that must be executed at least once5. While loop is entry control loop5. Do while is exit control loop