what program we write for nested if in c++ to print something after else part but before inner if else
if(condition){
}
else
//something we want to print
if(condition){
}
else{
}

Answers

Answer 1

Answer:

if(condition){

}

else  {

  // something we want to print

  if(condition) {

     // ...

  }

  else {

     // ...

  }

}

Explanation:

Create code blocks using curly braces { ... }.

Use proper indentation to visibly make it clear where code blocks start and end.


Related Questions

Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores

Answers

Answer:

Explanation:

The following is written in Java. It is a method/function that takes the oldScore as an int input. It turns it into a String, separates all the digits, puts them into an array. Then adds the first digit to the end and removes it from the beginning, thus shifting the entire score one to the left. Then it turns the String variable back into an Integer called finalScore and prints it out.

public static void newScore(int oldScore) {

       ArrayList<Integer> newScore = new ArrayList<>();

       String stringOldScore = String.valueOf(oldScore);

       for (int x = 0; x < stringOldScore.length(); x++) {

           newScore.add(Integer.parseInt(String.valueOf(stringOldScore.charAt(x))));

       }

       newScore.add(newScore.get(0));

       newScore.remove(0);

       String newScoreString = "";

       for (int x:newScore) {

           newScoreString += String.valueOf(x);

       }

       int finalScore = Integer.parseInt(newScoreString);

       System.out.println(finalScore);

   }

Are Dogs are better than video games?

Answers

sometimes bc dogs are very lovey but video games also have there moments

Answer:

In some cases yes.

Explanation:

Some days I really enjoy my video games and other days I enjoy being with my dog but sometimes they are annoying especially if they have way more energy than you

Write an application that counts the total number of spaces contained in a quote entered by the user.

Answers

Answer:

Explanation:

The following code is written in Java. It asks the user for an input and saves it in a String variable. Then it loops through all the characters in the string and counts the spaces. Finally, it prints the total number of spaces in the String.

public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter Line Now:");

       String userInput = in.nextLine();

       int spaceCount = 0;

       for (int x = 0; x < userInput.length(); x++) {

           if (userInput.charAt(x) == ' ') {

               spaceCount++;

           }

       }

       System.out.println(spaceCount);

   }

explain mechanical computer ,electromechanical and electronic computer with example

Answers

Answer:

A mechanical computer uses moving parts to do it’s calculations. Think old style adding machines.Electronic computers use electronic oscillators to generate a clock. The oscillator might include a mechanical element such as a crystal, but the majority of the clock signal is processed in the electrical domain.

Explanation:

An example of a mechanical computer clock is a Swiss watch movement, which needs no electronics. Movement is based upon springs coupled to other mechanical pieces. Swiss watches are high precision mechanical computers that do counting. There are other types of more sophisticated mechanical computers. Research the works of Konrad Zuse and his Z1 mechanical computer.

describe PROM, EPROM and EEPROM memories​

Answers

Answer:

Explanation:

PROM is a Read Only Memory (ROM) that can be modified only once by a user while EPROM is a programmable ROM that can be erased and reused. EEPROM, on the other hand, is a user-modifiable ROM that can be erased and reprogrammed repeatedly through a normal electrical voltage.

answer 1 question and get 10 points in return

Answers

Answer:

3

Explanation:

sorry if I'm wrong...it's been a while since I took a coding class.

3 I think... hope this helps!

What was that show where lowe’s were based off eye colors and the main character had orange eyes that let her mind control people. It was either on netflix or hulu

Answers

The Innocents on Hulu i think

Answer:Raising Dion?

Explanation:

Was it Raising Dion?

References inserted initially as footnotes can be converted to endnotes through an option in the software.

A. True

B. False

Answers

The answer is A. True

The answer is: A) True

Other Questions
In the model for exponential growth or decay, the amount, or size, at t=0 is represented by __ the amount, or size, at time t is represented by __ What did the Treaty of Paris state A Mnica y su familia pa san in fin de semana de vacaciones. Di qu piensan hacer. Usa cada verbo slo una vez. 2/3y + 3/4 = 8/9 help Catching a wave, a 77 kg surfer starts with a speed of 1.3 m/s, drops through a height of 1.65 m, and ends with a speed of 8.2 m/s. How much non-conservative work was done on the surfer? Graph the greatest integer, f(x) = [x] What is the value of v? Please provide an explanation, thanks! Can someone help me plz How much time is required for a 20 Coulombs charge to flow through a point if the current is 2 amperes? help plzzzzz what process produces sex cells (sperm and egg)? Cellular Respiration Osmosis Meiosis Mitosis Which of the following is the most important skill to develop when pursuing screenwriting as a career?editingscript doctoringversatilityteamwork Please help me in a hurry Let V=2 and let H be the subset of V of all points on the line 4x+3y=12. Is H a subspace of the vector space V? Which sentence makes a factual claim?A cat is a smarter choice of pet than a dog, for most people. Cats aregenerally less expensive to care for than dogs, and they require lesswork from their human owners. When my family goes out of town, wethink it's great that our cat Nate can basically take care of himself for acouple of days. And although they are different, cats are just as muchfun as dogs.What Find the equation of the linear function represented by the table below in slope-intercept form. x y 1 -9 2 -13 3 -17 4 -21 We must breath in__ so our cells can gain more___ If 3x + 7 = 5 for some value of x, then what does the expression 6x +17 equal for the same value of x? You are purchasing a book that cost $22.00. The sales tax is 8%. What is the total amount of your purchase? A. $0.18 B. $1.76 C. $23.76 D. $17.60 Please answer quickly, Karma is best described as a ________.A. Burial ritualB. System of justiceC. Dispute between godsD. Path to enlightenment how did martin luther protest against the sale of indulgences