Exforsys
+ Reply to Thread
Results 1 to 2 of 2

Difference Between Normal Executable Statement and Printf Statement

This is a discussion on Difference Between Normal Executable Statement and Printf Statement within the C and C++ forums, part of the Programming Talk category; What is the Difference Between Normal Executable Statement and Printf Statement? For example what the difference between i++ + ++i ...

  1. #1
    Praveen Chandra is offline Junior Member Array
    Join Date
    Jan 2006
    Answers
    16

    Difference Between Normal Executable Statement and Printf Statement

    What is the Difference Between Normal Executable Statement and Printf Statement?

    For example what the difference between i++ + ++i in normal executable statement
    z=i++ + ++i;

    and printf statement
    printf("%d",i++ + ++i);


  2. #2
    Sandhya.Kishannag is offline Member Array
    Join Date
    Feb 2012
    Answers
    66
    In executable statements we always require a constant to output the values where as in printf the constants required for output are readily available.Printf also allows to display contents of several variables in formatted output and also to provide text labels.


    In above example if i=2 then

    z=i++ + ++i gives output as z=7
    printf("%d",i++ + ++i); gives output 7


Latest Article

Network Security Risk Assessment and Measurement

Read More...