How to define variables in C language

王林
Release: 2020-06-16 15:29:36
Original
9858 people have browsed it

How to define variables in C language

The format for defining variables in C language is very simple, as follows:

数据类型  变量名;
Copy after login

Note: Do not lose the final semicolon. The definition of a variable is a statement, and statements end with a semicolon.

"Data type" indicates what type of variable you want to store. If you want to store integers, define it as int type; if you want to store decimals, define it as float or double type.

"Variable name" is what name you want to give this variable, usually using letters. For example:

int i;
Copy after login

The above statement indicates that an integer variable i is defined.

Recommended tutorial: c language tutorial

The above is the detailed content of How to define variables in C language. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!