Answered Questions

  • What is the return value from printf() function?

    printf function always returns the number of characters printed by the printf function. Let us see this in brief with an example: main() { int a=10; printf(“%d,printf(“%d %d %d,a,a,a)); } In this above program the inner printf is first called which prints three times the value of a, with space between each value namely 10 10 10. So 5 characters namely 3 value of a namely...

    Ayushee

    • Jul 12th, 2011

    Code
    1. #include<stdio.h>
    2. int main()
    3. {
    4. int a=10;
    5. printf("%d",printf("%d%d%d",a,a,a));
    6. printf("/n");
    7. printf("%d",printf("%d %d %d",a,a,a));
    8. return 0;
    9. }
    anwer would be 1010106 10 10 108