Posts

Showing posts from July, 2025

Tokens in C

Tokens in C            In C programming, tokens are the smallest units in a program that have meaningful representations. Tokens are the building blocks of a C program, and they are recognized by the C compiler to form valid expressions and statements. Tokens can be classified into various categories, each with specific roles in the program.   Types of Tokens in C The tokens of C language can be classified into six types based on the functions they are used to perform. The types of C tokens are as follows: 1. Punctuators The following special symbols are used in C having some special meaning and thus, cannot be used for some other purpose. Some of these are listed below: Brackets[]:  Opening and closing brackets are used as array element references. These indicate single and multidimensional subscripts. Parentheses():  These special symbols are used to indicate function calls and function parameters. Braces{}:  These opening and ending c...

Functions printf() and scanf() in C

  Functions printf() and scanf() in C The  printf() and scanf() functions  are the most commonly used functions in C Programming. These functions are widely used in majority of the C programs. In this tutorial, you will learn, what are these functions, how to use them in C Program. The  scanf()  and  printf()  functions are used for input and output in c programs receptively. These functions are defined in  stdio.h  header file, so you must include this header file in your program, if you are using any of these functions. printf() function: The prinf() function is used to display (or print) output on the console screen. Syntax of printf() function: printf ( "format string" , arguments ); The format string (or  format specifier ) is a string that is used for formatting the input and output. Format string always starts with a ‘%’ character. For example format string for integer is %d, for string %s, for float %f and so on. scanf() fun...