Hi Guest

HomePage

1 1

To improves our performance please Like Share Subscribe(Will boost us)

C Variables
Question Posted on 17 Aug 2020

Home >> Tutorial >> C Language >> C Variables

C Variables
Variable are use to store data and its value can be changed as well as it can be reused many times as we wants. Or we also can say that variable is a name of memory location.

We can also say that it is the way to represent memory location through symbol so that it can be easily identified.

Below is the syntax to define the variable:-

type variable_name;

And below is the example to declare variable:-


int x;
float y;
char z;


Here in above x,y,z are variables. And int, float, char are different data types.

We can also set the value to the variable as per given below syntax:-


int x=10,n=20; //declare 2 varible in single line with values
float y=10.98;
char z='A';



Rules to define variables


Below are 4 most important rules when defining variables in C language:-
(1)We can use alphabets, digits and underscore.
(2)We can start variable with alphabet and underscore only. But it cannot start with a digit.
(3)We cannot use whitespace in variable name.
(4)we cannot use variable name that is reserved word or keyword like int,float, char etc.

valid variable names:-
int a;
int _xyz;
int x20;

Invalid variable names:-
int 2;
int a b;
int long;
0
0



Most Visited Questions:-

Deep Learning Questions Answers
Below are the different Deep Leaning Questions and answer a More...

Continuous Integration Questions Answers
Below are the 20 odd questions for CI or Continuous Integra More...

Derived relationships in Association Rule Mining are represented in the form of __________.
Derived relationships in Association Rule Mining are repres More...

What is Gulpjs and some multiple choice questions on Gulp
Gulpjs is an open source whihc helps in building Javascript More...

Microservices Architecture Questions Answers
Below are the different questions on Microservices Architec More...




Other Important Questions
Features of C
Introduction to C
History of C Language
Install C Language
C Variables






Most Visited Questions
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |
     
 
Privacy policy | Terms and Conditions | Blog


If the copyright of any questions or content or syntax belong to you email us we will remove that(info@crackyourinterview.com or crackyourinterview2018@gmail.com)
 

1
Home About Us GroupChat
 
Sitemap Feedback Contact us