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
Vesnalui [34]
3 years ago
14

Write an if-else statement to describe an integer. Print "Positive even number" if isEven and is Positive are both true. Print "

Positive number" if isEven is false and is Positive is true. Print "Not a positive number" otherwise. End with newline.
Computers and Technology
1 answer:
Nina [5.8K]3 years ago
6 0

Answer:

C code explained below

Explanation:

#include <stdio.h>

#include <stdbool.h>

int main(void) {

int userNum;

bool isPositive;

bool isEven;

scanf("%d", &userNum);

isPositive = (userNum > 0);

isEven = ((userNum % 2) == 0);

if(isPositive && isEven){

  printf("Positive even number");

}

else if(isPositive && !isEven){

  printf("Positive number");

}

else{

  printf("Not a positive number");

}

printf("\n");

return 0;

}

You might be interested in
Which one of these are a valid IPv4 address? Check all that apply.
Illusion [34]
The answer is C.54.45.43.54
6 0
3 years ago
Write a program that use a switch statement whose controlling expression is the variable area code. If the value of area_code is
scZoUnD [109]

Answer:

Table for Area codes are not missing;

See Attachment for area codes and major city I used

This program will be implemented using c++ programming language.

// Comments are used for explanatory purposes

// Program starts here

#include <iostream>

using namespace std;

int main( )

{

// Declare Variable area_code

int area_code;

// Prompt response from user

cout<<Enter your area code: ";

cin<<"area_code;

// Start switch statement

switch (area_code) {

// Major city Albany has 1 area code: 229...

case 229:

cout<<"Albany\n";

break;

// Major city Atlanta has 4 area codes: 404, 470 678 and 770

case 404:

case 470:

case 678:

case 770:

cout<<"Atlanta\n";

break;

//Major city Columbus has 2 area code:706 and 762...

case 706:

case 762:

cout<<"Columbus\n";

break;

//Major city Macon has 1 area code: 478...

case 478:

cout<<"Macon\n";

break;

//Major city Savannah has 1 area code: 912..

case 912:

cout<<"Savannah\n";

break;

default:

cout<<"Area code not recognized\n";

}

return 0;

}

// End of Program

The syntax used for the above program is; om

6 0
3 years ago
Write a program that produces this output:
AveGali [126]

Answer:

void printC()  

{  

   int i, j;  

   for (i = 0; i < 4; i++) //i indicate row number. Here we have 5 rows

       {  

         printf("C"); //print C for every row  

         for (j = 0; j < 6; j++) //j indicate column number. Here we have 7 Rows

         {  

           if (i == 0 || i == 4) //For first and last row  

               printf("C"); //print 'CCCCCCC'

          else if (i = 1|| i= 3) //for Second forth row  

                printf("C        +      +"); //print 'C    +    +'

          else if (i = 2) For second row  

                printf("C       +++++"); //print 'C +++++'

           else

               continue; //to jump to next iteration

         }  

         printf("\n"); // print in next line

}  

}

4 0
3 years ago
Can u please help me solve this
azamat

Alice has twice as many pencils as Cara. Leon has three more pencils than Alice. The three children have a total of 58 pencils.

<h3>What are the no. of pencils?</h3>

The no. of pencils are there totally as the 11.

Read more about the basic maths:

brainly.com/question/19493296

#SPJ1

4 0
2 years ago
How do I write this code in java? input "Enter Your Age to Order a Beer"
Klio2033 [76]

Answer:

i dont know sorry but answer above lol

Explanation:

5 0
3 years ago
Other questions:
  • Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending whe
    12·1 answer
  • A client accessing a network share folder has authenticated into the system and has full access rights to a folder share. But af
    11·1 answer
  • An iframe is an inline table for a website. True False i need an answer fast
    15·1 answer
  • Please answer this a due tomorrow!!!
    5·1 answer
  • Why do we need vram​
    6·1 answer
  • Write a parent program to fork(2) n processes where n is passed tothe program on the command line, and n can be from 1 to 10. Al
    12·1 answer
  • What is a good analogy for explaining the actions of a compiler?
    10·1 answer
  • The biggest limitation of a network operating system (NOS) is _____ in terms of memory, process, device, and file management.
    7·1 answer
  • 5. In what ways is the human brain like a computer? In what ways is it different?
    15·2 answers
  • Input two numbers and print their sum products difference division and remainder​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!