Learn in One-Day Rating 5.0 out of 5

C Language in One Day (Basics of C Language)

C Language in One Day (Basics of C Language) Oct. 2, 2021

Content:

  1. Introduction to C Language
  2. Functions
  3. Arrays
  4. Pointers
  5. Strings
  6. Enumerated, Structure and Union Types
  7. Files

Introduction to C Language

Identifiers: Identifiers are names given to different entities such as constants, variables, structures, functions, etc.

Example 1:

int age;
double number;

In above example age & number are identifiers.

Data Types: The data-type in a programming language is the collection of data with values having fixed meaning as well as characteristics. In example 1, int & double are data types.

There are 5 data types in C language-

  1. void            -  No value
  2. int               -  Integer numbers
  3. float            -  Floating point numbers
  4. char            -  Characters
  5. double        - Floating point numbers with high precision 
int age = 20;
char c = 'A';
double number = 123.374574;
float amount = 35.50;

Variables and Constants: Variables are memory locations(storage area) in the C programming language. Constants are like a variable, except that their value never changes during execution once defined.

const int age = 20;

Input / OutputIn C programming you can use scanf() and printf() predefined function to read and print data.

#include<stdio.h>

void main()
{
int a,b,c;
printf("Please enter any two numbers: \n");  //Asking values
scanf("%d %d", &a, &b);                      //Storing values
c =  a + b;
printf("The addition of two number is: %d", c);
}

Output

Please enter any two numbers:
12
3
The addition of two number is:15

 


Rate this post

Comments