In programming, the terms "line" and "statement" always mean the same thing.

jacob777baltimore

jacob777baltimore

Posted on November 26, 2020

In programming, the terms "line" and "statement" always mean the same thing.

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;
}
Enter fullscreen mode Exit fullscreen mode

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.

There are four types of control statements

Read more

💖 💪 🙅 🚩
jacob777baltimore
jacob777baltimore

Posted on November 26, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related