0 0 votes #include<stdio.h> void main() { int i; printf("%d", scanf("%d",&i)); //provide input as 100; } Programming in C programming-in-c + – meethunjadhav 733 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
3 3 votes scanf returns how many inputs you provided you are providing one input ===> printf prints 1 as output if your statement is like this printf("%d", scanf("%d %d",&i,&j)); ===> o/p is 2 Shaik Masthan answered Jul 9, 2018 Shaik Masthan comment Share Follow See all 3 Comments 3 3 Comments reply Naveen Kumar 3 commented Jul 9, 2018 reply Follow flag here, i'm getting runtime error https://ideone.com/jTdd8F 0 0 replyShare Shaik Masthan commented Jul 9, 2018 reply Follow flag problem with your code is return type of main return type of main is should be int, why because after successful run of main function it returns the return value 1 to OS, then only OS says that program successfully executed, if os doesn't get value 1 from main, OS says it's an error. 2 2 replyShare Naveen Kumar 3 commented Jul 9, 2018 reply Follow flag yes & also i was not providing input. this -> https://ideone.com/wTaWnl is working fine! thanks @ Shaik 0 0 replyShare Please log in or register to add a comment.