Question: explain the program and its output 1. Result SSD Sgcc -o main ..c-im $main 123.125000 assigned to an int produces 123 -150 assigned to a

explain the program and its output
explain the program and its output 1. Result SSD Sgcc -o main

1. Result SSD Sgcc -o main ..c-im $main 123.125000 assigned to an int produces 123 -150 assigned to a float produces -150.000000 -150 divided by 100 produces -1.000000 -150 divided by 100.0 produces -1.500000 (float) -150 divided by 100 produces -1.500000 = Execute > Share main.c STOIN 1 #include 2 int main (void) 3 { 4 float f1 = 123.125, f2; 5 int ii, i2 = -150; 6 char c = 'a'; 7 il - f1; floating to integer conversion 8 printf ("%f assigned to an int produces %i ", fi, il); 9 f1 = 12; // integer to floating conversion 10 printf ("%i assigned to a float produces %f ", i2, f1); 11 f1 - 12 / 100; // integer divided by integer 12 printf ("%i divided by 100 produces %F ", i2, f1); 13 f2 i2 / 100.0; // integer divided by a float 14 printf ("%i divided by 100.0 produces %f ", i2, f2); 15 f2 - (float) i2 / 100; // type cast operator 16 printf ("(float) %i divided by 100 produces %f ", i2, f2); 17 return; 18 }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!