C examples for Language Basics:Variable
Does a simple calculation using the values of the variables
#include <stdio.h> int main(void) { int total;/*from w ww .j a v a2 s . co m*/ int cats; int dogs; int ponies; int others; cats = 4; dogs = 3; ponies = 5; others = 6; total = cats + dogs + ponies + others; printf("We have %d pets in total\n", total); // Output the result return 0; }