Chapter-2(Basic Fundamental tool) | Code2night.com
Code2night
  • Home
  • Blogs
  • Guest Posts
  • Tutorial
  • Post Blog
  • Register
  • Login
  1. Home
  2. Blogpost

Chapter-2(Basic Fundamental tool)

Date- Dec 09,2023

1438

1. Character Sets:

A character set is a set of characters with a specific encoding scheme used for representing textual information in a programming language. In C, the basic character set includes letters, digits, and special characters.

Example:-

#include<stdio.h>

#include<conio.h>

void main()

{

     clrscr();

   char myChar='A';

   printf("Character: %c\n", myChar);

   getch();

}

2. Keywords:

Keywords are reserved words in a programming language that have a predefined meaning. These words cannot be used as identifiers (names for variables, functions, etc.) because they are already used by the language.

Example:-

#include<stdio.h>

#include<conio.h>

void main() 

{

    clrscr();

    int num = 5;

    if(num > 0) {

        printf("The number is positive.\n");

    }

  getch();

}

In this example, 'if' is keywords. instead of this example while, for, break, goto, else also are keywords.

3. Data Types:

A variable's data type defines the kind of data it can store. C supports various data types, including int, float, char, double, etc.

Example:-

#include <stdio.h>

#include <conio.h>

void main() 

{

   clrscr();

    int integerVar = 10;

    float floatVar = 3.14;

    char charVar = 'A';

   printf("Integer: %d\n", integerVar);

    printf("Float: %f\n", floatVar);

    printf("Character: %c\n", charVar);

     getch();

}


4. Constants:

Constants are values that do not change while a program is running. They come in a variety of forms, including integer constants, floating-point constants, and character constants.

Example:-

#include <stdio.h>

#include<conio.h>

#define PI 3.14159 // Macro for a constant

void main() 

{

   clrscr();

    const int MAX_VALUE = 100; // Constant variable

  printf("PI: %f\n", PI);

    printf("Max Value: %d\n", MAX_VALUE);

  getch();

}

5. Variables:

Variables are containers for storing data values. Before they can be utilized, they need to be specified with a data type.

Example:-

#include <stdio.h>

#include<conio.h>


void main() 

{

   clrscr();

    int age; // Declaration

    age = 25; // Initialization

    printf("Age: %d\n", age);

    getch();

}

In this example, age is a variable of type int.


These fundamental concepts are the building blocks of C programming, and understanding them is crucial for writing effective and readable code.

Comments

Tags

LinkedinLogin
LinkedinProfile
GetLinkedinProfile
C#
Aspnet
MVC
Linkedin
ITextSharp
Export to Pdf
AspNet Core
AspNet
View to Pdf in Aspnet
Model Validation In ASPNET Core MVC 60
Model Validation
Model Validation In ASPNET Core MVC
Model Validation In ASPNET
Image Compression in AspNet
Compress Image in c#
AspNet MVC
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1210
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp Join Us On Facebook

Welcome To Code2night, A common place for sharing your programming knowledge,Blogs and Videos

  • Panipat
  • info@Code2night.com

Links

  • Home
  • Blogs
  • Tutorial
  • Post Blog

Popular Tags

Copyright © 2025 by Code2night. All Rights Reserved

  • Home
  • Blog
  • Login
  • SignUp
  • Contact
  • Terms & Conditions
  • Refund Policy
  • About Us
  • Privacy Policy
  • Json Beautifier
  • Guest Posts