/*Calculations: plus */
#include <stdio.h>
void main()
{
int total; /* The total number */
int cats; /* The number of cats */
int dogs; /* The number of dogs */
/* Set the number of each kind of pet */
cats = 2;
dogs = 1;
/* Calculate the total number of pets */
total = cats + dogs;
printf("We have %d pets in total", total); /* Output the result */
}
|