

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Write a program that outputs the following line: The "first" \LAB\ in 'CS499'
The following program has several errors. Modify it so that it will compile and run without errors: #include <stdio.h> double f2c( double ); int main() { double fahrenheit = 32.4; double celsius = f2c( fahrenheit ); printf( "fahrenheit = %d\t celsius =%f\n", fahrenheit, celsius); return 0; } double f2c( float f ){ Return (f -32) *5 / 9; }
Using only the techniques you have learned up now, write a program that calculates the squares and cubes of the integers from 0 to 9 and print the following neatly and formatted table of values: 0 0 0 1 1 1 2 4 8 3 9 27 4 16 64 5 25 125 6 36 216 7 49 343 8 64 512 9 81 729
What happens when you try to compile and run the following program? #include <stdio.h> int main() { int k = 1; int i = ++k + + k++; printf( "%d\t%d\n", i, k ); return 0; } Try to explain the output
What happens when you try to compile and run the following program? #include <stdio.h> int main() { double i = - -1-3 * 10/5 -1; printf( "%f\n", i ); return 0; } Try to explain the output