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...

  • 1. How do you insert a “break point” in your script? 2. What happens to the...

    1. How do you insert a “break point” in your script? 2. What happens to the execution of a script when MATLAB encounters a break point? Is the execution ended? 3. What happens if a break point is inserted within a loop (like a for loop)? 4. How do you step through different lines of the code during the debugging session? 5. How can you see the values of a particular variable when the debug session is active? 6. Are...

  • Please do in Java with the code available for copy :) Write a computer program that...

    Please do in Java with the code available for copy :) 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...

  • 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....

  • What is the value of GPA when grade is 'B' in the following code segment? int...

    What is the value of GPA when grade is 'B' in the following code segment? int GPA=0; switch (grade) { case 'A': case 'a': GPA = GPA + 1; case 'B': case 'b': GPA = GPA + 1; case 'C': case 'c': GPA = GPA + 1; case 'D': case 'd': GPA = GPA + 1; } 4 3 2 1 None of the above #2.   Branching - switch statements... Extra info/hint? It's free What is the value of GPA when...

  • 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...

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