← Back to Articles List

Basics of C Program

Basic Data Types
There are four basic data types in C program.
 Data type Size
 char 1 byte
 int 2 or 4 bytes
 float 4 bytes
 double 8 bytes
 
Type Casting
Suppose you have two int type variables num_players and total_score. Your instructor asks you to find the average score per player. 

You declare a double type variable average and write the calculation statement as: average = total_score / num_players. Your answer will output as integer !