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,951
  • 1
  • 16
  • 33
soda
  • 443
  • 6
  • 19

0 Answers0