0

the sum function doesn't have any return type specified also it doesn't have any return statement still the output on a turbo c compiler is 5. Can anyone explain why, I guess it's because the printf function prints 5 characters and maybe returns the number of characters printed.

#include<stdio.h>
#include<conio.h>

sum()
{
    printf("hello");
}

void main()
{

    int k;
    k = sum();

    clrscr();
    printf("%d",k);
    getch();

}
Marievi
  • 4,831
  • 1
  • 12
  • 33
soda
  • 413
  • 7
  • 17

0 Answers0