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

programm in c, need answers for all the questions, ty!!!I will rate. Run the fol

ID: 3673220 • Letter: P

Question

programm in c, need answers for all the questions, ty!!!I will rate.

Run the following program. What is the output? (1.5 pts) #include int main(void) t 1. float f1 1.00001, f2 = 1.000001, f3 = 1.0000001; printf("%.10f, %.10f, 96.10f ", f1, f2, f3); return 0; 2. What is the output of the following programs if the user enters 3 6.7 for both: (4pts) #include int main(void) ( int i1, i2; printf("Enter an int and a float n"); scanf("%d %d", &i1;, &i2;); printf(%d %d %f%f ", i1, i2, i 1,2); return 0 #include int main(void) t float f1, f2; printf("Enter an int and a float n"); scanf("%f %f", &f1;, &f2;); printf("%d %d %1%fin", f1, f2, f1, f2); return 0

Explanation / Answer

1. It will print the values upto 10 decimal places as

1.0000100136,1.0000009537,1.0000001192

2. It will print integer values for integers and 0 for float values

10 12 0.000000 0.000000

3.

#include <stdio.h>

typedef float MONEY;
#define EXCHANGERATE 1.38
int main(void)
{
   MONEY usdAmount,cadAmount;
   printf("Enter the USD amount");
   scanf("%f",&usdAmount);
   cadAmount=usdAmount*EXCHANGERATE;
   printf("The amount in CAD is %f ", cadAmount);
  
   return 0;
}

4. This question requires a bit of attention. Here the size is machine dependent and compiler dependent. Actually the size of variable depends on the word size of the machine or architecture of the machine. E;g My machine has word size of 4 bytes (32 bit machine) so the integer variable will be of size 4 bytes, on 64 bit machine it will be 8 bytes. Thus one should keep this difference in mind while answeing this question.

Now coming to question as my machine is 32 bit so the integer will take 4 bytes and character always take 1 byte, thus value of x1 will be 1, x2 will be 4 and since x3 contains the size of array of 5 integer elements, its value will be 5* size of integer (i:e 5*4=20). So the output on my machine is 1 4 20