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
-BARSIC- [3]
3 years ago
9

Using for loop . Input an integer and identify whether it's EVEN OR ODD ( without using modulo operator )

Computers and Technology
1 answer:
vladimir2022 [97]3 years ago
6 0

Answer:

Following are the program in c++ language

#include<iostream> // header file

using namespace std; // namespace

int main()  

{

int n1,i; // variable declaration

cout<<"Enter Number: ";

cin>>n1; // input number

for(i=n1;i>1;i=i-2) // check the condition  

{

n1 = n1-2; // decrement the value of number by -2  

}

if(n1==0) // check if it is 0

cout<<"number is EVEN"<<"\n"; // print even

else

cout<<"number is ODD"<<"\n"; // print odd

return 0;

}

Output:

Enter Number: 45

number is ODD

Again run the program

Enter Number:10

number is EVEN

Explanation:

In this program, we input the number by a user in variable n1. After that, we iterate the for loop and initialize the value of a variable" i" in for loop and check the condition.

In each iteration, the variable n1 is decrement by 2 and store it n1.

Finally, check if n1==0 then it print number is EVEN  otherwise it print number is ODD.

You might be interested in
Why did the creation of ARPANET help with this critical need?
charle [14.2K]
<span>Scientists needed a way to work together to share their research and findings. Especially after a nuclear exchange.</span>
8 0
3 years ago
What specific record type is found in every zone and contains information that identifies the server primarily responsible for t
ValentinkaMS [17]

The SOA is the specific record type found in every zone and contains information that identifies the sever primarily responsible for the zone as well as some operational properties for the zone.

Explanation:

The Start of Authority Records (SOA) has the following information they are

Serial Number: This number is used to find when zonal information should be replicated.

Responsible person: The Email address of a person is responsible for managing the zone.

Refresh Interval: It specifies how often a secondary DNS server tries to renew its zone information.

Retry Interval: It specifies the amount of time a secondary server waits before retrying the zone information has failed.

Expires After: IT specifies the amount of time before a secondary server considers its zone data if it can't contact with the primary server.

Minimum TTL: It specifies the default TTL value for a zone data when a TTL is not supplied.

4 0
3 years ago
When purchasing a mobile computer, you should determine the form factor that meets your needs. What is a form factor?
Ilia_Sergeevich [38]

Answer:

A FORM FACTOR is the shape, size/dimension and all physical specifications of an electronic device. It refers to the hardware in computers.

It determines the compatibility of several devices despite the manufacturer.

Examples of motherboard form factors include:

- ATX: this is the most common motherboard form factor for desktop computers today

- AT

-BTX

-DTX

-ITX

-Full AT

-Full ATX

-Micro-ITX

-MicroATX

-Mobile-ITX

8 0
3 years ago
_____ is a major factor in the widespread use of global information systems
Paha777 [63]

Answer:

E-business

Explanation:

7 0
4 years ago
Which of the following statements is true according to the code?
mihalych1998 [28]

Answer:

The #intro style applies to all paragraphs.

Explanation:

It is a class

A class applyies to all with that name

5 0
4 years ago
Other questions:
  • The political spectrum spans from Communism on the extreme left to __________ on the extreme right. /8178757/1f6bdbf3?utm_source
    6·2 answers
  • Write the equivalent c++ expression for the following algebraic expressions
    11·1 answer
  • In the following code, what values could be read into number to terminate the while loop? Scanner keyboard = new Scanner(System.
    8·1 answer
  • Advantages of heading attributes
    5·1 answer
  • The information that’s displayed in a datalist control is defined by _____.
    10·1 answer
  • What does a converter do? A. It converts one technological system into another. B. It converts one type of electrical signal int
    10·2 answers
  • Subjective Questions
    11·1 answer
  • What symbol shows autocorrect is in use in access? WILL MARK BRAINLIEST FOR WHOEVER ANSWERS FIRST!!!
    5·1 answer
  • To improve readability and maintainability, you should declare ________ instead of using literal values such as 3.14159.
    14·1 answer
  • A social service agency hires accenture to improve training and experiences for caseworkers. What is one way accenture can use v
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!