No, the Statement is a group of lines.
One statement contains many lines
For example:
int main()
{
int x, y;
printf("enter the value of x:");
scanf("%d", &x);
printf("enter the value of y:");
scanf("%d", &y);
if (x>y)
{
printf("x is greater than y\n");
}
if (x<y)
{
printf("x is less than y\n");
}
if (x==y)
{
printf("x is equal to y\n");
}
printf("End of Program");
return 0;
}
The above example contains 22 lines but 3 number of Statements are three.
Line
Lines of code are the "source code" of the program, and one line may produce one machine guidance or a few relying upon the programming language. ... In an elevated level language, for example, C++ or Java, one line of code produces a progression of low-level computing construct guidelines, which brings about different machine directions.
Statements
In PC programming, a Statement is a syntactic unit of a basic programming language that communicates some activity to be done. A grouping of at least one explanation shapes a program written in such a language. An announcement may have inward part
Type of statements
Assignment statements are used to assign a program variable. Flow control explanations help direct the request where statements are performed.
Top comments (4)
Hey, thanks for sharing! BTW, you can tag code blocks with a language for better highlighting by adding
c
after your first 3 backticks .EDIT: noticed your code was written in C, this applies to several languages though
Greatest!
Thanks Man!!!
Thanks man!!!
I will try that.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.