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
What is a critique of the feature detector model of object recognition?​?
Leya [2.2K]
Found a similar question that had choices, here are the choices:
a.Specific neurons that respond to round, square or irregular shapes do not integrate their signals to recognize multi-shaped objects.
b. It accounts only for the recognition of simple two dimensional shapes, not more complex three-dimensional shapes.
c.Feature detector neurons have been found in non-human primates, but not in humans themselves.
<span>d. It does not account for the fact that our expectations influence what we see.

My answer:
d. It does not account for the fact that our expectations influence what we see.

We all have different expectations, thus, our view on certain object is subjective. It is a product of said expectations. </span>
4 0
3 years ago
Write a program that reads a file containing text. Read each line and send it to the output file, preceded by line numbers. If t
Shtirlitz [24]

Answer:

I am writing a JAVA program:

import java.io.FileReader;  // class used for reading data from a file

import java.io.IOException;  //class used for handling exceptions

import java.io.PrintWriter;  // class used to printing or writing formatted data. It is used when the data to be written contains text and numbers

import java.util.Scanner;   // class used to take input from the user

public class Main  {  //start of the class

public static void main(String[] args)  {//start of main() function body

Scanner input = new Scanner(System.in);  //creates Scanner class object

System.out.print("Enter the input file name: ");  // prompts user to enter the input file name

String input_file = input.next();  //to  read and return the token i.e. input file name and store this into input_file String type variable

System.out.print("Enter the output file name: "); // prompts user to enter the output file name

String output_file = input.next();   /to  read and return the token i.e. output file name and store this into output_file String type variable

try   {/* try  defines a chunk of code to be tested for errors during the execute of this chunk. its a code block for reading from input file and writing to output file. This handles the exception if program cannot create or write to the file indicated. */

   FileReader inFile = new FileReader(input_file);  //creates object inFile of FileReader class to read the input_file contents

   Scanner scan = new Scanner(inFile);  //read and scans the input file

   PrintWriter outFile = new PrintWriter(output_file);  //creates object outFile of PrintWriter class to write to the output file. It is used to write output data in a readable text form.

   int count = 1;    //counts the line number      

   while (scan.hasNextLine())  {  //loop keeps checking for the next line in input file

    String lines = scan.nextLine();  // reads the entire line of the input file and stores that line contents in String lines

    outFile.println("/* " + count + " */ " + lines);  //each line represented with line number enclosed in /* */

    count++;  }   //increments the line number at each iteration    

    outFile.close();        }  //closes the output file after writing the contents from input file with each line of the input file enclosed in  /* */

catch (IOException e)  {  // catching the IOException and prints the following message if program cannot create input_file or write to the output_file

   System.out.println("Error processing file: " + e);    }     }   }

Explanation:

The program is well explained in the comments mentioned with each statement of the above program. The user is prompted to enter input and output file names. Then the program uses a while loop that scans through lines of the input file and count variable counts each line of input file. Then at each iteration the count variable counts a line of input file and line number of each line of the input file is enclosed in /* */ delimiters. The contents of input file, in which the line numbers of text lines of the input file are enclosed in /* */ delimiters, is written to the output file.

The screenshot of the program is attached along with the output file produces as a result of this program execution.

7 0
3 years ago
which two functions are performed at the llc sublayer of the osi data link layer to facilitate ethernet communication? (choose t
Ivahew [28]

Answer:

implements CSMA/CD over legacy shared half-duplex media; enables IPv4 and IPv6 to utilize the same physical medium; integrates Layer 2 flows between 10 Gigabit Ethernet over fiber and 1 Gigabit Ethernet over copper

Explanation:

I hope it helped . follow me on ig minisized._miyaa

8 0
3 years ago
Give your definition of a view. Based on the Academic Database, identify and describe a scenario where it would be necessary to
il63 [147K]

Answer:

A database view is a searchable object in a database that is defined by a query. Though a view doesn't store data, some refer to a views as “virtual tables,” you can query a view like you can a table. A view can combine data from two or more table, using joins, and also just contain a subset of information.

Explanation:

A database view is a subset of a database that is based on a query that runs on one or more database tables. Database views are saved in the database as named queries and can be used to save complete queries that are frequently used.

7 0
3 years ago
Match the following
kakasveta [241]

Answer:

Eraser tool -removes the unwanted part of the drawing.

Row -horizontal space running from left to right.

Text -Primary component of a multimedia.

Drawing Area -Working are of ms point program.

I hope this helps!! Correct me plz if I'm wrong. If I'm right, could you mark me as brainliest?

8 0
3 years ago
Other questions:
  • Write the interface (.h file) of a class ContestResult containing: An data member winner of type string, initialized to the empt
    14·1 answer
  • In the C-SCAN disk scheduling algorithm, the disk arm is required to move in one direction only until it reaches the last track
    7·1 answer
  • Discuss Hashing and how it is utilized within the IT industry. Also, discuss how Hashing can improve our sorting and searching r
    12·1 answer
  • Find a, b, and c<br> A a=4 square root of 6 b= 8 square root of 2 ; c= 4 square root of 2
    12·1 answer
  • The sequence of folders to a file or folder is called a(n) ________
    8·1 answer
  • The type of database that is connected by a company's local area networks is a(n:
    11·1 answer
  • How do assignment article computer security, ethics and privacy?
    15·1 answer
  • True or False: Mapping annotations are exclusive - an annotated method will only be accessible to requests sent to a matching UR
    14·1 answer
  • PLEASE SOMEONE ANSWER THIS
    14·2 answers
  • I re-made the human version of Daddy Dearest from Friday Night Funkin
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!