C Variables


  • Variables are containers for storing data values.

(ভেরিয়েবল ডাটার মান সংরক্ষণ করে।)

In C, there are different types of variables (defined with different keywords), for example:

          • int - stores integers (whole numbers), without decimals, such as 123 or -123.

(int - দশমিক ছাড়া পূর্ণসংখ্যা (সম্পূর্ণ সংখ্যা) সংরক্ষণ করে, যেমন 123 বা -123)

          • float - stores floating point numbers, with decimals, such as 19.99 or -19.99.

(float - ফ্লোটিং পয়েন্ট সংখ্যা সংরক্ষণ করে, দশমিক সহ, যেমন 19.99 বা -19.99)

          • char - stores single characters, such as 'a' or 'B'. Char values are surrounded by single quotes

(char - একক অক্ষর সংরক্ষণ করে, যেমন 'a' বা 'B'। চার মান একক উদ্ধৃতি দ্বারা বেষ্টিত হয়)

  • double - same as integer. just take more memory.

Declaring (Creating) Variables

  • To create a variable, specify the type and assign it a value:

Example :

or

Note: If you assign a new value to an existing variable, it will overwrite the previous value:

Example :