Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Answer each of the following C Programming questions. Assume all variables are p

ID: 3832137 • Letter: A

Question

Answer each of the following C Programming questions. Assume all variables are properly declared.

Please Follow below 'C' Programming programs set guidelines and write program set below as documented in the detailed instructions below. Thank you so much

****All programs must be written using the VC++ 2015 compiler****

*****PLEASE DOUBLE CHECK TO MAKE SURE PROGRAM COMPILES AND DOES NOT SUFFER RUNTIME ERROR*******

A) Required Items/Software:

Visual C++ 2015 (Visual Studio 2015 Professional or Visual Studio Express 2015)

Capture the output from at least two different test cases (actual output) and either submit a text file or a screen shot of the output in a .doc file.

Textbook: PROGRAMMING IN C, 4th Edition Stephen G Kochan.

F. What is the output of the following code segment? int Ctr x 5; for (ctr 0; ctr 3; ctr++ ctr printf ("%d x); printf ("%d", ctr); G. What is the value of x after the following code segment? int x 5, y 3; x x 2; y 2. while (y 7); H. How many elements does the following array have? int bowling Score [6][12] I. What will be the values of k[1] and k 3] after execution of the code segment below using the data shown? 2 0 1 alues read in int k[6] 10, 0, 0, 0, 0, 0); int i, n; for (i 3; i K 6; ++i) t scanf ("%d", &n;) J. AC program contains the following variable declarations double a 2.5, b 0.0005, c 3000.0 Show the output resulting from the following printf statements. Use a for a blank. printf ("%5.2f %5.2f %4.2f", a, b, c);

Explanation / Answer


F)
Given:  
   x = 5

   x = 5 + 0
   x = 5 + 1
   x = 6 + 2

   final value of ctr = 3

   Output: 5683

G)
Given:
   x = 5, y = 3

   y takes value: 3,5,7

   x = 5*2 = 10 for y=3
   x = 10*2 = 20 for y = 5
   x = 20*2 = 40 for y=7

   Output: x = 40

H)
   int bowlingScore[6][12]

   There are 6 rows and each row has 12 columns

   Total elements: 12*6 = 72

I)
   loop runs for:
   i = 3, 4, 5

   for i=3
   k[2] = 3

   for i=4
   k[0] = 4

   for i=5
   k[1] = 5

   So, k[1] = 5
   k[3] = 0

J)
   double a=2.5, b=0.0005, c=3000.0
   printf("%5.2f %5.2f %4.2f", a, b, c);

   ####2.50 ####0.00 3000.00