Monday, 24 February 2014

If statement in C


If statement



The keyword "if" tells the compiler that what follows is decision control statement.

"If" statement is a conditional branching statement. In conditional branching statement a condition is evaluated,if it is evaluate true a group of statement is executed,or if it is evaluate false then statement are skipped.


For example, by using an if statement to check a user entered password, your program can decide whether a user is allowed access to the program.

Syntax of if statement is:-

If(condition is true)

Execute this statement;

The condition following the keyword "if" is always enclosed with in a pair of parentheses. If the condition is true then execute the statement if false then the statement is not executed, instead the program skips past it.

The block of statements to be executed must be enclosed in opening and closing braces. If only one statement needs to be executed then braces need not be used.

Example of if program

main()

{

Int num;

Printf(“enter the number\\n”);

Scanf(“%d”,num);

If (number>0)

Printf(“number is positive”);

}


Answered by Sunil 
student, OCC (Online coaching Class)
 www.onlinecoachingclass.org

14 comments:

  1. While searching the MBBS study information I got this website. I am medical student need to know how to apply MBBS in Georgia?

    ReplyDelete
  2. While searching the MBBS study information I got this website. I am medical student need to know how to apply MBBS in Kazakhstan?

    ReplyDelete
  3. hello if you want promotional products gifts visit at corporate gifts?

    ReplyDelete
  4. hello friends if you have any solution in mechanical design visit at Mechanical Design Solution?

    ReplyDelete
  5. hello friends if you have any Mechanical Design Services visit at Mechanical Design Services?

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Gmail instant technical support , our technician will help you 24/7. This is our toll-free number for UK peoples.
    Gmail Technical Support

    ReplyDelete
  8. Gmail instant technical support , our technician will help you 24/7. This is our toll-free number for UK peoples.
    Gmail Technical Support

    ReplyDelete
  9. Gmail instant technical support , our technician will help you 24/7. This is our toll-free number for UK peoples.
    http://gmail-support-number.uk/gmail-technical-support

    ReplyDelete
  10. Great blog article about this topic,I have been lately in your blog once or twice now.I just wanted to say hi and show my thanks for the information provided. THANKS! Instrumentation Engineering

    ReplyDelete
  11. Hi
    Thank you for sharing New Blog, your all blog is informative and I am waiting for your new blog, thank you again for sharing the blog.


    car insurance | car insurance | travel insurance in oman

    ReplyDelete