Basic Outout

Basic output


Output simple text.



Write a statement that prints the following on a single output line. End with a newline.

3 2 1 Go!



#include <stdio.h>

int main(void) {

printf("3 2 1 Go!\n");

return 0;
}


Output simple text with newlines.


Write code that prints the following. End each output line with a newline.

A1

B2

#include <stdio.h>

int main(void) {

printf("A1\n");
printf("B2\n");

return 0;
}


Output text and variable.


Write a statement that outputs variable numCars as follows. End with a newline.

There are 99 cars.

#include <stdio.h>

int main(void) {
int numCars = 99;

printf("There are %d cars.\n", numCars);

return 0;
}

 


Contact Me
thebookdale@gmail.com