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
suter [353]
3 years ago
11

Create a function, return type: char parameters: int *, int * Inside the function, ask for two integers. Set the user responses

to the int * parameters. Prompt the user for a character. Get their response as a single character and return that from the function. In main Define three variables and call your function. Print values of your variables
Computers and Technology
1 answer:
iris [78.8K]3 years ago
4 0

Answer and Explanation:

In C programming language:

char fun(int*a, int*b){

printf("enter two integers: ");

scanf("%d%d",a,b);

int e;

printf("please enter a character: ");

e=getchar();

return e;

}

int main(int argc, char *argv[]) {

int d;

int f;

int g;

fun();

printf("%d%d%d", d, f, g);

}

We have declared a function fun type char above and called it in main. Note how he use the getchar function in c which reads the next available character(after the user inputs with printf()) and returns it as an integer. We then return the variable e holding the integer value as char fun() return value.

You might be interested in
The operating system’s application programming interface (API) provides software developers with tools they use to build applica
lubasha [3.4K]

Answer:

True

Explanation:

Application Programming Interface (API) is a set of commands, functions, protocols, and objects that programmers can use to create software or interact with an external system. It provides developers with standard commands for performing common operations so they do not have to write the code from scratch.

Operating system APIs are typically integrated into the software development kit for the corresponding program. For example, Apple's Xcode IDE allows developers to drag and drop elements into an application's interface. It also provides a list of available functions and includes syntax highlighting for known elements and commands.   Operating system APIs have a robust set of features.

3 0
2 years ago
Write a program that reads a list of integers, and outputs whether the list contains all even numbers, odd numbers, or neither.
Volgvan

Question:

Write a program that reads a list of integers, and outputs whether the list contains all even numbers, odd numbers, or neither. The input begins with an integer indicating the number of integers that follow. Assume that the list will always contain less than 20 integers.

Answer:

Written in Python

listlent = int(input("Length of List: "))

mylist = []

mylist.append(listlent)

for i in range(listlent):

    num = int(input(": "))

    mylist.append(num)

<em>    </em>

evens = 0

odds = 0

for i in range(1,listlent+1):

    if mylist[i]%2==0:

         evens=evens+1

    else:

         odds=odds+1

       

if(evens == 0 and odds != 0):

    print("All Odds")

elif(evens != 0 and odds == 0):

    print("All Even")

else:

    print("Neither")

Explanation:

This prompts user for length of the list

listlent = int(input("Length of List: "))

This initializes an empty list

mylist = []

The following iteration reads the list items from the user

<em>mylist.append(listlent)</em>

<em>for i in range(listlent):</em>

<em>     num = int(input(": "))</em>

<em>     mylist.append(num)</em>

   

The next two lines initialize even and odd to 0, respectively

<em>evens = 0</em>

<em>odds = 0</em>

<em />

The following iteration if a list item is even or odd

<em>for i in range(1,listlent+1):</em>

<em>     if mylist[i]%2==0:</em>

<em>          evens=evens+1</em>

<em>     else:</em>

<em>          odds=odds+1</em>

This checks and prints if all list items is odd        

<em>if(evens == 0 and odds != 0):</em>

<em>     print("All Odds")</em>

This checks and prints if all list items is even        

<em>elif(evens != 0 and odds == 0):</em>

<em>     print("All Even")</em>

This checks and prints if all list items is neither even nor odd

<em>else:</em>

<em>     print("Neither")</em>

4 0
2 years ago
10 10 105 Each process is assigned a numerical priority, with a higher number indicating a higher relative priority. In addition
Grace [21]

Answer:

see explaination and attachment

Explanation:

We can say that a Gantt chart is a visual view of tasks scheduled over time. Gantt charts are used for planning projects of all sizes and they are a useful way of showing what work is scheduled to be done on a specific day.

see attachment for the detailed step by step solution.

3 0
3 years ago
__________ is a very simple form of lossless data compression in which runs of data (that is, sequences in which the same data v
babymother [125]

Answer:

The correct answer to the following question will be "Run-length encoding (RLE)".

Explanation:

RLE seems to be useful for replicated information, swapping it with a qualify as well as a copy of something like a repeat element.

  • Optimized dictionary strategies construct a table of sequences, then substitute appearances of chords with simpler codes.
  • This is a straightforward type of data compression, where data runs become stored as an individual data count as well as a value rather than as the initial run.

8 0
3 years ago
An online bank wants you to create a program that shows prospective
ladessa [460]

Answer: I can't really code a whole thing for you but use VS Code for this it'll make your life easier in the long run.

8 0
2 years ago
Other questions:
  • It is a good idea to use more than one typeface in a document when _____.
    8·2 answers
  • The set of specific, sequential steps that describe exactly what a computer program must do to complete the work is called a(n _
    14·1 answer
  • Keion works as a freelancer creating websites and designing logos for clients. He recently had a hard drive failure and lost wor
    7·1 answer
  • Suppose that a is a one-dimensional array of ints with a length of at least 2. Which of the following code fragments successfull
    8·1 answer
  • Experienced students may serve as mentors if they are at least age 21 and have at least 3 years of post-secondary education. In
    5·1 answer
  • The larger the Word Size of a computer
    6·1 answer
  • What does the binary odometer show about representing large numbers​
    15·1 answer
  • ☢☢☢does anyone know how to do the TYNKER CANNON assignment ( lesson 2 intro to game design) I'll give BRANLIEST(¬‿¬)❤ dont answe
    11·2 answers
  • I need help about computer program. Solve C language code...... please​
    7·1 answer
  • Which statement best describes the computers all around us?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!