Basic Structure of a C program

#include<stdio.h>
int main() {
/* Printing Ashok world in the ouput */
printf("Ashok World");
return 0;
}
output
Ashok World

What is a character set in c

The C character set consists of upper and lower alphabets, digits, special characters and white spaces. The alphabets and digits are altogether as the alphanumeric character.

Symbol NameSymbolSymbol NameSymbol
Comma,Plus sign+
Period.Opening angle bracket<
Semi Colon;Closing angle bracket>
Colon:Opening parenthesis(
Question Mark?Closing parenthesis)
Single Quotes' 'Opening square bracket[
Double Quotes" "Closing square bracket]
Exclamation Mark!Opening brace{
Vertical Bar|Closing brace}
Tilde~Forward slash/
underscore_Back slash\
Dollar sign$Vertical tab\v
Percent sign%Blank space\b
Number sign#New line\n
Ampersand&Carraige return\r
Caret^Form feed\f
Asterisk*Horizontal tab\t
Minus sign-White space character

Keywords in C

We can define the |keywords as the reserved or pre-defined words that hold their own importance. It means that every keyword has a functionality of it's own. Since the keywords are basically predefined words that the compilers use, thus we cannot use them as the names of variables. If we use the keywords in the form of variables names, it would mean that we assign a different meaning to it something that isn't allowed. The C language provides a support for 32 keywords, as mentioned below.

autobreakcasechar
constcontinuedefaultdo
doubleelseenumextern
floatforgotoif
intlongregisterreturn
shortsignedsizeofstatic
structswitchtypedefunion
unsignedvoidvolatilewhile

Data Types in C

Data types in C refer to an extensive system used for declaring variables or functions of different types. The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted.

datatypes

Primary Data type

The C language has 5 basic(primary or primitive) data types, they are:
Integer:Used to store whole numbers like 1, 2, 100, 1000, 2096, etc... Floating - point: Decimal point or real numbers values like 99.2, 10.23, 4232.334433 , etc... Character: ASCII character set or generally a single alphabet like 'a', 'C', etc... Double: Very large numeric values which are not allowed in integer or floating point type. Void: This means no value. This data type is mostly used when we define functions.

Derived Data Types

The C language supports a few derived data types. These are:

Arrays

The array basically refers to a sequence (oreded sequence) of a finite number of data items from the same data type sharing one common name.

Structures

A collection of various different types of data type items that get stored in a contagious type of memory allocation is known as structure in C. In some of the situations, we can also call the structures and unions to be UDT(user-defined Data Types).

Unions

The unions are very similar to the structures. But here, the memory that we allocate to the largest data type gets reused for all the other types present in the group.

Pointers

The Pointers in C language refer to some special form of variable that can one use for holding other variables addresses.

Function

A Function in C refers to a self-contained block of single or multiple statements. It has its own specified name.

User -Defined Data types

C suuports a feature known as "type definition" that allows users to define identifier that would represent an existing data type. The user defined data types have an two types:

  1. typeof
  2. enumerated data type