1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Arlecino [84]
3 years ago
14

Show the exact output of the following codesegments:(a) for(x=0; x<20; x=x+2)cout<< x << ‘ ‘;cout<< endl ;(

b) i=10;for (;i>0; i =i/2;)cout<< i;
Computers and Technology
1 answer:
egoroff_w [7]3 years ago
3 0

Answer:

a)

for(x=0;x<20;x=x+2)

cout<< x << ' ';

cout<< endl ;

<u>Output</u>

0 2 4 6 8 10 12 14 16 18

In this code we are initialing x with 0, check if it is less than 20, then printing the value 0.

Then we increment x value with 2 and check and print again until the x value tends to be equal or more than 20.

<u>C++ program for verifying</u>

#include <iostream>

using namespace std;

int main()

{

   int x;

   for( x=0;x<20;x=x+2)

      cout<< x << ' ';

      cout<< endl ;

   return 0;

}

<u>Output</u>

0 2 4 6 8 10 12 14 16 18

(You can check on any ide for confirmation)

b)

i=10;

for (;i>0; i =i/2;)

cout<< i;

This code will produce error expected ‘)’ before ‘;’ token

  for(;i>0; i =i/2;)

because for loop consist three parameters and in this loop there are 4 parameters.

If we remove semicolon after i/2,

for(;i>0; i =i/2)

then it will produce an output.

10 5 2 1

<u>C++ program for verifying</u>

#include <iostream>

using namespace std;

int main() {

int i=10;

 for(;i>0; i =i/2;)

 cout<< i;

return 0;

}

<u>Output</u>

Error-expected ‘)’ before ‘;’ token

  for(;i>0; i =i/2;)

You might be interested in
_____ is a problem-solving technique where each problem in a database is stored with a description and keywords that identify it
babymother [125]

Answer:

Case-based reasoning.

Explanation:

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to create, store, modify, retrieve and manage data or informations in a database. Generally, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

A data dictionary can be defined as a centralized collection of information on a specific data such as attributes, names, fields and definitions that are being used in a computer database system.

In a data dictionary, data elements are combined into records, which are meaningful combinations of data elements that are included in data flows or retained in data stores.

This ultimately implies that, a data dictionary found in a computer database system typically contains the records about all the data elements (objects) such as data relationships with other elements, ownership, type, size, primary keys etc. This records are stored and communicated to other data when required or needed.

Basically, when a database management system (DBMS) receives data update requests from application programs, it simply instructs the operating system installed on a server to provide the requested data or informations.

Case-based reasoning is a problem-solving technique where each problem in a database is stored with a description and keywords that identify it. It is typically based on cognitive science and artificial intelligence.

7 0
2 years ago
In which view of PowerPoint is the Annotation tools menu available?
lara31 [8.8K]

Answer:

2.

Explanation:

Annotating in PowerPoint is the create notes while delivering a PowerPoint presentation. This could be done in two ways.

First, right click with the mouse and select 'pointer options'. Then you can choose either pen or highlighter to circle certain word or highlight any line.

The second way of creating annotation is by going to View→Normal→Notes.

After you select 'notes', a pane will appear at the bottom of your presentation.

So, the correct answer that annotation tools menu is available in Normal. Thus option 2 is correct.

7 0
2 years ago
Read 2 more answers
In a class hierarchy,
kondor19780726 [428]

Answer:

The correct answer to the following question will be Option D.

Explanation:

  • A collection of nested title scopes are defined by the class hierarchy, even though a collection of nested methodologies as well as blocks see in an everything else.
  • From the all, the lexical role characterizes the connection between certain scopes of names - if method d would be decided to declare somewhere within procedure c, therefore the namespace within the namespace of c would be nested.
  • The more common classes in such a family hierarchy were near the peak of the tree as well as more specific classes are towards the edges.

Other choices have no connection with the given situation. So Option D seems to be the right response.

4 0
3 years ago
It is a good idea to include your teacher’s name on a title page.
LenaWriter [7]

Answer: I think it all depends on the teacher because I know one of my teachers like when we put their name on our assignments. So I pick true

Explanation:

6 0
3 years ago
Read 2 more answers
The temperature in toronto canada was-4°c and tje temperature in brixton,england was 6°c warmer. what was the difference in temp
Oksana_A [137]

Answer:

It is 10°c difference between them

7 0
3 years ago
Other questions:
  • What is TCP/IP's Transport layer's primary duty?
    8·1 answer
  • ________ are found on the motherboard and are used to attach your hard disk.
    6·1 answer
  • Footnotes and endnotes can be used to explain information in more detail, add opinions or comments, or to cite sources in the do
    7·1 answer
  • Write a basic program that performs simple file and mathematical operations.
    6·1 answer
  • 1. Define a C++ function with the name evaluateBook. The function receives as one argument the name of the file to be processed
    13·1 answer
  • Which of the following is the net effect of the following combination of share and NTFS permissions when the share is accessed o
    7·1 answer
  • The M:N relationship between STUDENT and CLASS must be divided into two 1:M relationships through the use of the ENROLL entity;
    10·2 answers
  • Nj hj hjkbh hj g7yubuyiycrtdryfrrcctcftt
    12·2 answers
  • Roger wants to give semantic meaning to the contact information, which is at the bottom of the web page. To do this he will use
    5·1 answer
  • What does CPU stand for
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!