×

Advanced Coding & Software Engineering Program

Duration: 1 Year (12 Months)

Join our premium 1-year program to master cutting-edge technologies and become an industry-ready Software Engineer!

Course Coverage

  • Languages: C, C++, Java, JavaScript, Python
  • Web Technologies: HTML, CSS, Bootstrap 5, MERN Stack, Full Stack Development
  • Databases: MySQL, MongoDB
  • Data Science Libraries: Pandas, NumPy
  • Development Tools: Visual Studio Code, IntelliJ IDEA, PyCharm, Postman, Git, GitHub
  • Cloud Platforms: Vercel, MongoDB Atlas

Program Highlights

  • Live Classes: Interactive sessions with real-time doubt resolution
  • Hands-On Sessions: Practical coding exercises to build real-world skills
  • Industry Experts: Learn from professionals with years of experience
  • Live Project: Work on real-world projects to apply your skills
  • Get Certificate: Earn a professional certificate upon program completion

Course Fee: Only ₹1020 / month
Limited Period Offer!

Basic Syntax of C



Last Updated on: 3rd Jul 2025 03:35:42 AM

Understanding the basic syntax is the first step toward writing correct and clean C programs. The syntax defines how statements, functions, and blocks should be written for the compiler to understand and execute the program properly.

 

1. Tokens in C

In C programming, a token is the smallest meaningful unit in the code. The compiler breaks the source code into these tokens for processing.

There are 6 types of tokens in C:

 

a. Keywords

  • These are reserved words that have predefined meanings in the C language.

  • You cannot use them as variable or function names.

 

Examples: int, float, if, else, while, return, break, switch

 

keyword                 perpose


int                        Defines integer type

return                    Ends a function and returns a value

if , else                  Used for conditional logic

 

2. Structure of a C Program

Every C program follows a standard structure. Here's a simple example:

 

#include <stdio.h>      // Preprocessor directive

int main() {            // Main function starts
    // Code statements go here
    return 0;           // End of program
}

 

Breakdown of the Structure:


 

Section Description
#include <stdio.h> Tells the compiler to include the Standard Input Output header file
int main() Every C program starts with the main function
{ ... } Curly braces define the body of the function
return 0; Ends the program and returns control to the system

 

2. Basic Rules of c Syntax :

  • Every statement ends with a semicolon (;).

  • C is case-sensitive. (total and Total are different).

  • The program starts executing from the main() function.

 

Example – Simple Program Structure

 

#include <stdio.h>

int main() {
    int number = 10;   // variable declaration
    number = number + 5;
    return 0;
}

 

Summary : 

  • Tokens are the building blocks: keywords, identifiers, constants, operators, etc.

  • C programs start from the main() function and are built using proper syntax rules.

  • Use semicolons, follow case sensitivity, and organize your code using functions and blocks.

 


Online - Chat Now
Let’s Connect

Inquiry Sent!

Your message has been successfully sent. We'll get back to you soon!

iKeySkills Logo