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
PIT_PIT [208]
3 years ago
5

2. Write a simple program in C++ to investigate the safety of its enumeration types. Include at least 10 different operations on

enumeration types to determine what incorrect or just silly things are legal. Now, write a C program that does the same things and run it to determine how many of the incorrect or silly things are legal. Compare your results.

Computers and Technology
1 answer:
erastovalidia [21]3 years ago
6 0

Answer:

Check the explanation

Explanation:

To solve the question above, we will be doing some arithmetic and bit wise operations on enum values. in addition to that, we are asserting the array with INTCOUNT  and also printing the size of array i.e 12 and we are adding BIG_COUNT enum value to 5 and the result is 25.

#include<stdio.h>

enum EnumBits

{

ONE = 1,

TWO = 2,

FOUR = 4,

EIGHT = 8

};

enum Randoms

{

BIG_COUNT = 20,

INTCOUNT = 3

};

int main()

{

// Basic Mathimatical operations

printf("%d\n",(ONE + TWO)); //addition

printf("%d\n",(FOUR - TWO)); //subtraction

printf("%d\n",(TWO * EIGHT)); //multiplication

printf("%d\n",(EIGHT / TWO)); //division

// Some bitwise operations

printf("%d\n",(ONE | TWO)); //bitwise OR

printf("%d\n",(TWO & FOUR)); //bitwise AND

printf("%d\n",(TWO ^ EIGHT)); //bitwise XOR

printf("%d\n",(EIGHT << 1)); //left shift operator

printf("%d\n",(EIGHT >> 1)); //right shift operator

// Initialize an array based upon an enum value

int intArray[INTCOUNT]; // declaring array

// Have a value initialized be initialized to a static value plus

int someVal = 5 + BIG_COUNT; //adding constant and BIG_COUNT variable

printf("%d\n",someVal); //value will be 25

printf("%d",sizeof(intArray)); //value will be 12

return 0;

}

Kindly check the attached image below for the Code and Output Screenshots:

You might be interested in
One of the following is NOT a type of Intellectual Property
zmey [24]

Group of answer choices.

a) Copyright

b) Trademark

c) Trade Secrets

d) Privacy​

Answer:

d) Privacy​

Explanation:

An intellectual property can be defined as an intangible and innovative creation of the mind that solely depends on human intellect.

Simply stated, an intellectual property is an intangible creation of the human mind, ideas, thoughts or intelligence. They include intellectual and artistic creations such as name, symbol, literary work, songs, graphic design, computer codes, inventions, etc.

Generally, there are different types of intellectual property (IP) and this includes;

a) Copyright

b) Trademark

c) Trade Secrets

However, privacy is a type of intellectual property.

5 0
3 years ago
These are pictorial images displayed on a computer screen​
Mrrafil [7]

Answerthats nice

(: -With Star

Explanation:

3 0
2 years ago
PLEASE HELP ASAP!!!!111 Read "Teenagers are rewriting the rules of the news" (find it somewhere and answer questions below)
Ilya [14]

Answer:

Sorry, we picked up your question late. There are a lot of questions, and every now and then some misses out. And I am sure you will understand. However, the cool thing is your answers are correct. I read the complete article on young adults or teenagers and found the same. And I am sure you will agree with the facts, and use its best meaning in your own life. I am, however, listing below all the answers for your complete satisfaction. And I congratulate you, you are up with the correct list of answers.

The answer to the First question is:

B. the description of how influencers follow young social media users"

Second question answer is

C. Andrew Yang

And the third question answer is:

C. Teens and young adults consume and spread news information through social media.

And I am sure you must have liked this article. Article reading is a good habit. You should always start a day by reading one article online or in newspaper.

Explanation:

Please check the answer section.+

4 0
3 years ago
You have a notebook computer and wish to connect to an IEEE 802.11n wireless network. The computer does not have a built-in wire
Ira Lisetskai [31]

Answer:

The wireless adapter to use is the Wireless USB 2.0 Extender

Explanation:

The Wireless USB 2.0 Extender is a USB component that enables a computer to connect to and communicate with other computers on a network, or even to connect to the internet.

It uses an IEEE 802.11g radio platform and communicates within a radio frequency range of 2.4GHz.

Therefore, in cases where a notebook computer does not have a built-in wireless LAN card or PC card interface, you can use the Wireless USB 2.0 Extender as the best solution to that problem.

3 0
3 years ago
What is the simplest way to permanently get rid of an unwanted file? A. Cancel the file. B. Go to the Start menu and then delete
Morgarella [4.7K]
Go to the Start menu and then delete the file <span>is the simplest way to permanently get rid of an unwanted file</span>
5 0
4 years ago
Other questions:
  • Assign True to the variable is_ascending if the list numbers is in ascending order (that is, if each element of the list is grea
    6·1 answer
  • The endocrine system is composed of many parts of the body.<br> a)True<br> b)False
    11·2 answers
  • What Are Some Tips To Pass (Cisco ADVDESIGN) 352-001 Exam?
    12·1 answer
  • you are configuring a firewall to all access to a server hosted in the demilitarized zone of your network. You open IP ports 80,
    7·1 answer
  • Maggie is preparing a business report. Which types of keys will she use to type out words and numbers?
    9·1 answer
  • What is the root of the tree?
    6·1 answer
  • Write a recursive function that calculates the sum 11 22 33 ... nn, given an integer value of nin between 1 and 9. You can write
    10·1 answer
  • Demonstrate the register addressing mode for the following instructions. Also what addressing mode belongs to these instructions
    11·1 answer
  • Function of printer and speaker​
    5·1 answer
  • Question:
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!