Basic elements of c language part 2:
we discussed about basic element in c in previous chapter so, we will continue the chapter of basic element in c.
Variable declaration:
if we make any variable then we reserved a specific place in the memory for the variable. variable declaration is so important because our compiler does not understand anything without declaration.
so we can say that variable declaration is a identity give to compiler. what i am doing in program.
syntax of variable declaration,
datatype variable name;
for example
void main()
{
int a=5; // variable declaration
printf("%d",a);
}
Here we can see we declare int type variable which name is a .so in our RAM memory a variable make 2 byte space for storing a particular data.
Statements in c language:
statement are the command which are given in programs for doing a specific task, like collect the inputs from the program.
for example:
#include<stdio.h>
void main()
{
int x=6;
int y=7;
if(x<y)
{
printf("variable x is less than y");
}
getch();
}
if condition(x<y) is true then the statement inside the body will be executed .
there are various types of statement is given below:
1)labeled statement
2)compound statement
3)iteration statement
4)expression statement
5jump statement
6)selection statement
we will discussed about these statements in details in our next chapter .
Labels: C language programming
1 Comments:
Well done Shukla G😍👌🏻
Post a Comment
Subscribe to Post Comments [Atom]
<< Home