+ 1

When I Run a Program below, Output is Nothing. Why?

#include<stdio.h> int main() { int count=0; printf("%c",count); return 0; }

29th Apr 2022, 11:49 AM
Rudra
Rudra - avatar
4 Answers
+ 3
The output is a character (%c) with value zero, which corresponds to NULL. So the output is probably NULL, not nothing. Try changing 0 to 48, for example.
29th Apr 2022, 11:59 AM
Emerson Prado
Emerson Prado - avatar
+ 4
%d %c is for character. For integer, %d should be used. https://code.sololearn.com/cL4nF8g4Iuhx/?ref=app
29th Apr 2022, 12:05 PM
Gordon
Gordon - avatar
+ 1
Emerson Prado Thanx Sir For Giving Explanation! I assign 48 to count variable in our Program, It get output as '0'. I understand. Again Thanx!
29th Apr 2022, 4:53 PM
Rudra
Rudra - avatar
+ 1
Gordon Thanx Bro!
29th Apr 2022, 4:53 PM
Rudra
Rudra - avatar