Welcome to the notes on Basic data types in C
programming:
Integers are whole numbers (positive or
negative) with no decimal points. For
example: int a = 10;
Doubles are real numbers with a decimal point.
For example: double b = 10.5;
Characters are single letters or symbols
enclosed in single quotes. For example: char c
= 'a';
Additionally, here are some other related concepts:
Arrays are used to store multiple values of the
same data type in a single variable. For
example: int arr[5] = {1, 2, 3, 4, 5};
Strings are arrays of characters that are
terminated with a null character ( '\0' ). They are
useful for storing and manipulating text. For
example: char str[6] = "hello";
Character vs String Input: In C, a single
character can be read using scanf("%c",
&ch) whereas a string can be read
using scanf("%s", str) .
Variables and Memory Addresses: Every
variable in C has a unique memory address, which
can be obtained using the & operator. For
example: int a = 10; printf("%p\n", &a);
Constants and Variables: Constants are values
that cannot be changed during the execution of a
programming:
Integers are whole numbers (positive or
negative) with no decimal points. For
example: int a = 10;
Doubles are real numbers with a decimal point.
For example: double b = 10.5;
Characters are single letters or symbols
enclosed in single quotes. For example: char c
= 'a';
Additionally, here are some other related concepts:
Arrays are used to store multiple values of the
same data type in a single variable. For
example: int arr[5] = {1, 2, 3, 4, 5};
Strings are arrays of characters that are
terminated with a null character ( '\0' ). They are
useful for storing and manipulating text. For
example: char str[6] = "hello";
Character vs String Input: In C, a single
character can be read using scanf("%c",
&ch) whereas a string can be read
using scanf("%s", str) .
Variables and Memory Addresses: Every
variable in C has a unique memory address, which
can be obtained using the & operator. For
example: int a = 10; printf("%p\n", &a);
Constants and Variables: Constants are values
that cannot be changed during the execution of a