I see that return type of putchar() is int,
int putchar(int char)
but
for(i=65;i<91;i++)
putchar(i);
gives output ABC...... How?Shouldn't it return int?
Plus, it turns out that I can use character in argument too.How?
I see that return type of putchar() is int,
int putchar(int char)
but
for(i=65;i<91;i++)
putchar(i);
gives output ABC...... How?Shouldn't it return int?
Plus, it turns out that I can use character in argument too.How?
Copyright © 2021 Jogjafile Inc.
You're not printing the return value. To print the return value, assign the result to another variable, and print that.
The output of this will be:
and so on up to
Zand90.65is the ASCII character code for the letterA.putchar()sends the character code to the terminal, which displays the corresponding character.