Thread: C statement

  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    28

    C statement

    Is every line terminated by ";" is a statement in C ?
    Which type of statement is "int i;" ?
    Is #include <stdio.h> is also a statement?

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    No. Declaration. No.

    Without context for the questions, there is little value in explaining the answers further.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #3
    Registered User
    Join Date
    Sep 2011
    Posts
    28
    Thanks for replying,

    Can you tell me an example where a line is ended by ";" and that line is not called as statement ?

  4. #4
    Registered User
    Join Date
    Sep 2012
    Posts
    68
    Quote Originally Posted by _arjun View Post
    Thanks for replying,

    Can you tell me an example where a line is ended by ";" and that line is not called as statement ?
    Every line(or a group of lines) in your program technically form statements.Literally, Statements are a part of your program that can be executed.

    Code:
    printf("Hello arjun");
    Hope it helps

  5. #5
    TEIAM - problem solved
    Join Date
    Apr 2012
    Location
    Melbourne Australia
    Posts
    1,907
    Can you tell me an example where a line is ended by ";" and that line is not called as statement ?
    Grumpy already has: A declaration

    A statement specifies an action to be performed - C11 draft 6.8 #2
    Fact - Beethoven wrote his first symphony in C

  6. #6
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by Click_here View Post
    Grumpy already has: A declaration
    Indeed. A declaration is not a statement.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What else could I use instead of this IF statement?
    By dsured in forum C Programming
    Replies: 7
    Last Post: 02-01-2011, 11:10 PM
  2. OR statement in C
    By Keylac in forum C Programming
    Replies: 8
    Last Post: 11-26-2009, 09:09 AM
  3. Statement inside a statement.
    By JOZZY& Wakko in forum C Programming
    Replies: 15
    Last Post: 11-05-2009, 03:18 PM
  4. what does this statement do?
    By timhxf in forum C Programming
    Replies: 8
    Last Post: 04-29-2007, 02:51 AM
  5. if statement
    By Joe100 in forum Game Programming
    Replies: 1
    Last Post: 12-07-2003, 05:57 AM

Tags for this Thread