Tutorial 2 – Declaring and Printing Integer Variables
What you will learn:
- how to declare an integer variable
- how to print an integer variable through the printf command
Here you have the principal types in C language:
Type Name | Minimum | Maximum |
signed char | -127 | 127 |
int | -32767 | 32767 |
long | -2147483647 | 2147483647 |
float | -1×1037 | 1×1037 |
double | -1×1037 | 1×1037 |
The format for the printf are:
Format | Corresponding Type |
“%d” | int |
“%ld” | long |
“%f” | float |
“%f” | double |
Prerequisite: You need to have the GCC compiler installed Follow the process written in this article to install it on Windows 10:
Check all the tutorials of the series here:
http://feaforall.com/category/programming/language-c-tutorials/
Leave a Reply