Question

1. How a program get compiled and executed on computer? [4 marks] 2. What do you understand by variable in programming? [4 ma
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)If a language is a compiled language,it should run through a compiler. The compiler the converts the high-level to machine level language.After compilation of a program,compiler creates object file. This object codes contains the machine instructions. object is not an executable file. So,it processed with linker. after this we got an executable file.

2)A variable is a value that can change  depending on the  instructions of a program.

3) if (total>=70)

{ printf("grade A");}

else if (total>=60 and total<70)

{ printf("grade B"); }

else if (total>=50 and total<60)

{ printf("grade c") }

else

{printf("fail");}

4)if(num1>num2)

{

if(num1>num3)

{

if(num1>num4)

{

printf("num1 is greater");

}

else

{

printf("num4 is greater");

}

}

else if(num1<num3)

{

if(num3>num4)

{

printf("num3 is greater");

}

else

{

printf("num4 is greater");

}

}

)

else if(num2>num3)

{

if(num2>num4)

{

printf("num2 is greater");

}

else

{

printf("num4 is greater");

}

}

else if(num 3>num4)

{

printf("num3 is greater");

}

else

{

printf("num4 is greater");

}

Add a comment
Know the answer?
Add Answer to:
1. How a program get compiled and executed on computer? [4 marks] 2. What do you...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Suppose this program is executed in a computer in which the clock rate for the processor is 1.6 MHz

    Figure 1: each block gives the number of different types of instructionsConsider a program with the execution flow shown in Figure 1. There are in total 3 types of instructions used in this program: Type 1 (in-processor calculation): execution rate as 1 per clock cycle; Type 2 (memory access): each instruction takes 2 clock cycles for execution; Type 3 (loop control): each instruction takes 2 clock cycles for jump into the loop block or 3 clock cycles for jump to the block after...

  • Write a computer program that prompts the user for one number, n for the number of...

    Write a computer program that prompts the user for one number, n for the number of items in the array to sort, and create and sort 1000 different arrays of this size timing the run to get an average time to sort an array of this size. Then do the following: Initiate a variable running_time to 0 Create a for loop that iterates 1000 times. In the body of the loop, Create an array of n random integers (Make sure...

  • Write c program. Do part 4 and 5 CH-12 TEXT FILES SE 12-3 Create a text file named grade.txt that you type yourself by your Each record in grade.txt should have the following format: by Columns...

    Write c program. Do part 4 and 5 CH-12 TEXT FILES SE 12-3 Create a text file named grade.txt that you type yourself by your Each record in grade.txt should have the following format: by Columns 1-4 6-8 number of a student A grade out of 100 EYERCISE 12-4 Write a program that will read the identification numbers of students and their letter grades (A, B, C, D, or F) from the keyboard and store them in a text file...

  • PYTHON PROGRAMMING Instructions: You are responsible for writing a program that allows a user to do...

    PYTHON PROGRAMMING Instructions: You are responsible for writing a program that allows a user to do one of five things at a time: 1. Add students to database. • There should be no duplicate students. If student already exists, do not add the data again; print a message informing student already exists in database. • Enter name, age, and address. 2. Search for students in the database by name. • User enters student name to search • Show student name,...

  • 3. WCS111 FM. Suppose you work at WCS111 FM, a radio station by computer scientists for...

    3. WCS111 FM. Suppose you work at WCS111 FM, a radio station by computer scientists for computer scientists. The station runs a contest where listeners win prizes based on how many hours they spend programming in Java. When a listener calls in to the radio station, the listener will state how many hours (whole number) a month he/she spends programming in Java. Based on the number of hours spent programming, display the listener prize according to the following rules: 1....

  • Jubail University College Computer Science & Engineering Department Assessmen Assignment Course Code CS120/C5101 t Type: 1...

    Jubail University College Computer Science & Engineering Department Assessmen Assignment Course Code CS120/C5101 t Type: 1 Semester: 403 Course Title Programming Submission 27-06-2020 Total Points 8 Date Submission Instructions: • This is an individual assignment. • Please submit your program (Java fle) in Blackboard. You can create one java project, named as Assignment1_id and add separate java file for each question. You can name your javá files as 01.02.... etc. • Make sure that you include your student ID name...

  • using C geany. Please Dr. exercise # 1 and 2 During the lab: PART I: PROGRAMMING...

    using C geany. Please Dr. exercise # 1 and 2 During the lab: PART I: PROGRAMMING EXERCISES a. Using Geany, write a C program that prompts and asks the user for two assignment marks (al and a2) and two test marks (ti and t2). All four variables are integer variables and are in % (out of 100). You program should display the four marks properly lalebed to check if the input has been successful. b. Next, calculate and display the...

  • Please post the code in c++! Computer Labs Write a Computer Labs program to store the...

    Please post the code in c++! Computer Labs Write a Computer Labs program to store the list of user IDs for each computer station using a linked list. Problem Description: You run four computer labs. Each lab contains computer stations that are numbered as shown in the table below: Lab Number Computer station Numbers 1-5 2 1-6 1-4 4 1-3 Each user has a unique five-digit ID number. Whenever a user logs on, the User's ID, labnumber, and the computer...

  • 1.You are to write a program name search.java that will do the following: 2.You are to...

    1.You are to write a program name search.java that will do the following: 2.You are to create 3 arrays - prompt the user for a number that is greater than 100 that will serve as the size for the arrays (all 3 arrays will have the same user input size). Call them A, B & C. 3.Generate this amount of random numbers to fill these arrays – the random numbers must range from 1 to 99. 4.Write 1 sequential search...

  • Write a Java program to meet the following requirements: 1. Prompt the user to enter three...

    Write a Java program to meet the following requirements: 1. Prompt the user to enter three strings by using nextLine(). Space can be part of the string). ( Note: your program requires using loop: for-loop, while-loop or do-while-loop to get the input String ) 2. Write a method with an input variable (string type).The method should return the number of lowercase letters of the input variable. 3. Get the number of the lowercase letters for each user input string by...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT