Constant in C With Example -

#include <stdio.h> 
int main()
{
const int WHOLENUM = 15;
WHOLENUM = 10;
printf("%d", WHOLENUM);
return 0;
}
  • Each program in C language starts with main() or int main() function. Inside this function, C program codes are executed and it starts with a curly brace and ends with a curly brace.
  • printf() function is used to print or display the output or text on the screen after program execution.

Types of Constant in C with Example

Numeric Constants:- There are two types of numeric constants.

  • String of characters constant:- Any string of characters including letters, digits, and symbols enclosed inside double quotes is called a string of characters constant. For eg:- “Total value is”

--

--

Hi, This is Biplab and I am web developer well versed in PHP and other open source technologies. I am here to share my experience with the community.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Bipsmedium

Bipsmedium

Hi, This is Biplab and I am web developer well versed in PHP and other open source technologies. I am here to share my experience with the community.