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
damaskus [11]
2 years ago
7

Write a program to input a number and check whether it is even or odd number

Computers and Technology
1 answer:
Mashutka [201]2 years ago
3 0

Answer:#include <stdio.h>

int main() {

   int num;

   printf("Enter an integer: ");

   scanf("%d", &num);

   // true if num is perfectly divisible by 2

   if(num % 2 == 0)

       printf("%d is even.", num);

   else

       printf("%d is odd.", num);

   

   return 0;

}

You might be interested in
Create a class called Book with the following properties using appropriate data types: Title, Author, numberOfPages, Create a se
tamaranim1 [39]

Answer:

I don't know the answer sorry

7 0
3 years ago
Given that a function receives three parameters a, b, c, of type double , write some code, to be included as part of the functio
hoa [83]

Answer:

   public static void quad(double a, double b, double c) {

       double D = (Math.pow(b, 2)) - (4 * a * c);

       if (D<0){

           System.out.println("no real solutions");

       }

   }

Explanation:

The code snippet above implements the function in Java programming language

As required by the question, the line  double D = (Math.pow(b, 2)) - (4 * a * c); evaluates b squared" - 4ac and assignes the value to the variable D

An if statement is used to test if D is less than 0, if this is true the message no real solutions is printed

5 0
3 years ago
What will be displayed after the following code executes? (Note: the order of the display of entries in a dictionary are not in
iren [92.7K]

Answer:

Nothing will be printed

Explanation:

You can easily find out that FL is not a member of the Dictionary. And we are checking these in the if. Since the if condition ends up being false, the further process will not run as they will only if the condition ends up being true. Hence, nothing will be printed.

Remember, del is used to delete a dictionary item. If this would have been a true condition for if then the FL item in the dictionary would have been deleted as it, in that case, would have been present there. And then the next line would have again added the FL item, and print would have printed the dictionary items with FL item as well. However, since if the condition is ending up being false, nothing will be printed.

If cities['FL'] and print is outside if then

the output will be

{'FL': 'Tallahassee', 'GA': 'Atlanta', 'NY': 'Albany', 'CA': 'San Diego'}

6 0
3 years ago
What is the maximum rate at which computers A and B can communicate, via router X? (your answer should be in Mbps)
eduard
450Mbps on the 2.4GHz band and 1300Mbps on the 5GHz band
7 0
3 years ago
What stdio.h input function would be used to get input from the user by the keyboard? Write the code to obtain the voltage drop
torisob [31]

Answer:

scanf() function is used to get a input from keyboard.This function is in the stdio.h library.To use this function we must include the stdio.h library first in the code. Then only we can use the scanf() function in any code.printf() function is used to print anything .this function is from stdio.h library.

Code to read voltage drop across the register.

#include <stdio.h>

// main function

int main(void) {

// variable

double vr1;

printf("Enter voltage drop:");

// read  voltage drop from user

scanf("%lf",&vr1);

// print voltage drop

printf("voltage drop is:%0.2lf",vr1);

return 0;

}

Output:

Enter voltage drop:200.4                                                                                                  

voltage drop is:200.40

8 0
3 years ago
Other questions:
  • If it can be applied, the least-damaging recovery option is ________.
    10·1 answer
  • Instructions: Type the correct answer in the box. Spell the word correctly.
    5·2 answers
  • 6. Which of the following is malware? (1 point)
    15·2 answers
  • Computer Architecture
    7·1 answer
  • ANYONE GOOD WITH CODING IN C++
    14·1 answer
  • You are a database administrator. Chantelle comes to you asking for help on how to access all the data in one row of the databas
    11·1 answer
  • Logical design is tied to a specific hardware and software platform. a. True b. False
    9·1 answer
  • What Is entered into the system as input?
    13·1 answer
  • Select the four bad password ideas.
    13·2 answers
  • Consider the following instructions for a game element: Move Forward If not at end, move forward Else stop This is an example of
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!