Mega Code Archive

 
Categories / C Tutorial / Data Type
 

Simple calculations

#include <stdio.h> int main(void) {   int Total_Pets;   int Cats;   int Dogs;   int Ponies;   int Others;   Cats = 2;   Dogs = 1;   Ponies = 1;   Others = 46;   Total_Pets = Cats + Dogs + Ponies + Others;   printf("We have %d pets in total", Total_Pets);  /* Output the result */   return 0; } We have 50 pets in total