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
Trava [24]
3 years ago
12

Write a C program that has the following statements: int a, b; a = 10; b = a + fun(); printf("With the function call on the righ

t, ");
Computers and Technology
1 answer:
mart [117]3 years ago
6 0

Answer:Following is the C program:-

#include <stdio.h>

int fun()//function fun of return type int and it returns value 6.

{

   return 6;

}

int main() {

  int a, b;

  a = 10;

  b = a + fun();//adds 6 to a.

  printf("With the function call on the right, ");

  printf("\n%d ",b);//printing b..

return 0;

}

Output:-

With the function call on the right,  

16

Explanation:

The function fun return the value 6 so it adds 6 to a and stores the result in b.

You might be interested in
A occurs when you reset a mobile device but retain your installed applications and personal settings
yaroslaw [1]

Answer:

Soft Reset

Explanation:

A Soft Reset is a type of reset in which a gadget such as smartphones, PC, or other related gadgets undergo to refresh or reset the device or makes certain applications work or function well without user data, settings and applications.

Hence, a SOFT RESET occurs when you reset a mobile device but retain your installed applications and personal settings

3 0
2 years ago
Read 2 more answers
Develop a C program that calculates the final score and the average score for a student from his/her (1)class participation, (2)
Ghella [55]

Answer:

#include <iomanip>

#include<iostream>

using namespace std;

int main(){

char name[100];

float classp, test, assgn, exam, prctscore,ave;

cout<<"Student Name: ";

cin.getline(name,100);

cout<<"Class Participation: "; cin>>classp;

while(classp <0 || classp > 100){  cout<<"Class Participation: "; cin>>classp; }

cout<<"Test: "; cin>>test;

while(test <0 || test > 100){  cout<<"Test: "; cin>>test; }

cout<<"Assignment: "; cin>>assgn;

while(assgn <0 || assgn > 100){  cout<<"Assignment: "; cin>>assgn; }

cout<<"Examination: "; cin>>exam;

while(exam <0 || exam > 100){  cout<<"Examination: "; cin>>exam; }

cout<<"Practice Score: "; cin>>prctscore;

while(prctscore <0 || prctscore > 100){  cout<<"Practice Score: "; cin>>prctscore; }

ave = (int)(classp + test + assgn + exam + prctscore)/5;

cout <<setprecision(1)<<fixed<<"The average score is "<<ave;  

return 0;}

Explanation:

The required parameters such as cin, cout, etc. implies that the program is to be written in C++ (not C).

So, I answered the program using C++.

Line by line explanation is as follows;

This declares name as character of maximum size of 100 characters

char name[100];

This declares the grading items as float

float classp, test, assgn, exam, prctscore,ave;

This prompts the user for student name

cout<<"Student Name: ";

This gets the student name using getline

cin.getline(name,100);

This prompts the user for class participation. The corresponding while loop ensures that the score s between 0 and 100 (inclusive)

<em> cout<<"Class Participation: "; cin>>classp; </em>

<em> while(classp <0 || classp > 100){  cout<<"Class Participation: "; cin>>classp; } </em>

This prompts the user for test. The corresponding while loop ensures that the score s between 0 and 100 (inclusive)

<em> cout<<"Test: "; cin>>test; </em>

<em> while(test <0 || test > 100){  cout<<"Test: "; cin>>test; } </em>

This prompts the user for assignment. The corresponding while loop ensures that the score s between 0 and 100 (inclusive)

<em> cout<<"Assignment: "; cin>>assgn; </em>

<em> while(assgn <0 || assgn > 100){  cout<<"Assignment: "; cin>>assgn; } </em>

This prompts the user for examination. The corresponding while loop ensures that the score s between 0 and 100 (inclusive)

<em> cout<<"Examination: "; cin>>exam; </em>

<em> while(exam <0 || exam > 100){  cout<<"Examination: "; cin>>exam; } </em>

This prompts the user for practice score. The corresponding while loop ensures that the score s between 0 and 100 (inclusive)

<em> cout<<"Practice Score: "; cin>>prctscore; </em>

<em> while(prctscore <0 || prctscore > 100){  cout<<"Practice Score: "; cin>>prctscore; } </em>

This calculates the average of the grading items

ave = (int)(classp + test + assgn + exam + prctscore)/5;

This prints the calculated average

cout <<setprecision(1)<<fixed<<"The average score is "<<ave;  

8 0
3 years ago
If a wire has insulation that allows it to operate in a temperature of up to 194 degrees Fahrenheit, what temperature will the w
zzz [600]
(194°F-32)×5/9
= 90°C
therefore the answer is 90degrees Celcius
6 0
3 years ago
Which layout manager constructor call would be best-suited to create a telephone handset GUI which has three rows of three keys
Snezhnost [94]

Answer:

The correct option : b. new GridLayout(4,3)

Explanation:

The total number of rows are 4 and total number of columns are 3.

So the total keys can be added is 4*3=12. This is suited for telephone keypad.

7 0
3 years ago
To get a page from the Web, a user must type in a URL, which stands for: a. Unknown Resource Locator b. Unknown Router Location
Afina-wow [57]

Answer:

Hey! The answer you're looking for is D. Uniform Resource Locator.

3 0
3 years ago
Other questions:
  • William found out that someone used his report on American culture without his permission. What is William a victim of?
    8·2 answers
  • Assume that the variables v, w, x, y, and z are stored in memory locations 200, 201, 202, 203, and 204, respectively.
    6·1 answer
  • An administrator has created a new custom object in a sandbox environment and now is ready to deploy in production. How can the
    11·1 answer
  • List all the components of a computer
    14·2 answers
  • ____ is a technique for confirming that q received packet or frame is likely to match what was sent
    15·1 answer
  • you are working on creating a business document with two other co-workers. Based on just information, which of the following pre
    14·1 answer
  • What will the following program display in the console?
    12·1 answer
  • Amogus :0) owo have a good day y'all
    12·1 answer
  • If you want to join all of the rows in the first table of a SELECT statement with just the matched rows in a second table, you u
    10·1 answer
  • Write the translator of third generation language​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!