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
Kaylis [27]
3 years ago
5

What happens if you try to compile and run this program?

Computers and Technology
1 answer:
Lynna [10]3 years ago
7 0

Your question is poorly formatted

<em>#include <stdio.h> </em>

<em>int main(void) { </em>

<em>int i, t[4]; </em>

<em>t[3] = 0; </em>

<em>for (i = 1; i >= 0; i--) </em>

<em>t[i] = t[3] * i; </em>

<em>printf("%d", +t[1]); </em>

<em>return 0; </em>

<em>}</em>

Answer:

It outputs 0

Explanation:

I'll start my explanation from the third line

This line declares an integer variable i and an array of 4 elements of type integer

<em>int i, t[4]; </em>

<em />

This line initialize the 3rd index element to 0

<em>t[3] = 0; </em>

<em />

The next two lines is an iteration;

The first line of the iteration iterates the value of i in descending order from 1 to 0

<em>for (i = 1; i >= 0; i--) </em>

<em />

This line of the iteration calculates t[1] as t[3] * i and t[0] as t[3] * i; Since t[3] is 0; both t[1] and t[0] will be 0

<em>t[i] = t[3] * i; </em>

<em />

This line prints t[1] which is 0

<em>printf("%d", +t[1]); </em>

You might be interested in
What is the location used by users to configure delegate access on their own mailboxes?
NeX [460]
Inbox? I think if wrong sorry
3 0
3 years ago
Read 2 more answers
What are your thoughts on copyright?<br><br> (Write 2 or more sentences)
victus00 [196]

Answer:

I look down on copyright. To take someone else's work and disguising it as your own seems like a form of theft.

5 0
3 years ago
Read 2 more answers
Write a cash register program that calculates change for a restaurant of your choice. Your program should include: Ask the user
eduard

Answer:

Python Code

Explanation:

total = 0.0

change = 0.0

itemone = float(input("Enter the first price: "))

itemtwo = float(input("Enter the second price: "))

itemthree = float(input("Enter the third price: "))

total = itemone + itemtwo + itemthree

print("Total:", total)

cash = float(input("Cash given: "))

change = total - cash

print("Your change:", change)

4 0
2 years ago
14 Convert the<br>following binary<br>numbers to decimal <br>0011​
xeze [42]

Answer:

.

Explanation:

4 0
2 years ago
Read 2 more answers
Write a fragment of code that will test whether an integer variable score contains a valid test score. Valid test scores are in
Klio2033 [76]

Answer:

Following are the code in the C Programming Language.

//set integer datatype variable

int score;

//check condition is the score is in the range of 0 to 100

if(score > 0 && score < 100){

//print if condition is true

printf("Valid test scores");

}else{

//otherwise print the following string.

printf("test scores are Invalid");

}

Explanation:

<u>Following are the description of the code.</u>

In the following code that is written in the C Programming Language.

  • Set an integer data type variable i.e., score.
  • Then, set the if conditional statement to check the condition is the variable "score" is greater than 0 and less the 100.
  • If the following statement is true then print "Valid test scores".
  • Otherwise, it print "test scores are Invalid".
5 0
3 years ago
Other questions:
  • What auto-generated elements can be added to the header and footer? A. Charts and Images B. Theme and Font Selection C. Author a
    8·2 answers
  • Which of these planets has the coldest surface temperature?
    6·2 answers
  • What are the advantages of upgrading computer hardware?
    13·2 answers
  • What did Fulton design in addition to the steamboat
    5·1 answer
  • The date June 10, 1960, is special because when it is written in the following format, the month times the day equals the year:
    5·1 answer
  • If i'm wanting to use hydra on linux to crack a password and the issue regarding hashes occurs, what shall i do?
    12·1 answer
  • Consider the code fragment below. Show the values stored at each location in memory and as they change while the code executes.
    5·1 answer
  • True or false: The objective of an Enterprise Resource Planning (ERP) system is to create a customized software program that int
    10·1 answer
  • Consider the following correct implementation of the selection sort algorithm.
    5·1 answer
  • Write the line of Python code that calculates and prints the answer to the following arithmetic expressions.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!