For each of the C++ programs shown below, write down exactly what you think the user would see as output if the program was executed.
// Program 1
#include <cstdio>
int main()
{
printf("Welcome to question 1");
printf("\n");
return 0;
}
|
// Program 2
#include <cstdio>
int main()
{
printf( "Welcome to question 2");
printf( "\n");
printf( "not much,");
printf( "but more than question 1.");
printf( "\n");
printf( "Bye!");
printf( "\n");
return 0;
}
|
// Program 3
#include <cstdio>
int main()
{
float Pi = 3.14;
float radius = 4;
float circumference = 2 * Pi * radius;
printf( "Welcome to question 3\n");
printf( "A circle of radius %f", radius);
printf( " has circumference %f\n", circumference);
return 0;
}
|