C Comments

By | September 24, 2023

Prerequisite – C Language Introduction

C comments explain code and improve readability. These do not affect program execution. You can use comments in C to clarify code and describe algorithms.

There are two types of comments in C: single-line (//) commnets and multi-line (/* */) comments.

1. Single-line comments start with “//” and end at the end of the line.

Example:

//this is a single line comment

2. Multi-line comments start with “/*” and end with “*/”.

Example:

/* This is a multi-line comment
Expand multiple lines */

Single-line comments can also be placed at the end of code lines.

 

Please write comments below if you find anything incorrect. A gentle request to share this topic on your social media profile.

Author: Mithlesh Upadhyay

I hold an M.Tech degree in Artificial Intelligence (2023) from Delhi Technological University (DTU) and possess over 4 years of experience. I worked at GeeksforGeeks, leading teams and managing content, including GATE CS, Test Series, Placements, C, and C++. I've also contributed technical content to companies like MarsDev, Tutorialspoint, StudyTonight, TutorialCup, and Guru99. My skill set includes coding, Data Structures and Algorithms (DSA), and Object-Oriented Programming (OOPs). I'm proficient in C++, Python, JavaScript, HTML, CSS, Bootstrap, React.js, Node.js, MongoDB, Django, and Data Science.