in Programming in C
919 views
0 votes
0 votes

What is o/p printed when i/p is =1 2 3

in Programming in C
919 views

2 Answers

2 votes
2 votes

'scanf' returns the number of items successfully read

so 

3

-1-2-3

4 Comments

Oh Gosh! Thank you!
0
0
i hope return values of printf or scanf never asked in GATE.
1
1
yes.. hope so
0
0
0 votes
0 votes
Answer will be: 3   (By printf("%d",scanf("%c%c%c",&x,&y,&z);)

                           -1- -2  (By printf("\n-%c-%c-%c",x,y,z);)

2 Comments

                           -1- -2  (By printf("\n-%c-%c-%c",x,y,z);)

Do you mean -1-2-3 ?

Also why is the output 3 here?

Answer will be: 3   (By printf("%d",scanf("%c%c%c",&x,&y,&z);)

0
0
Why -1- - 2(in second line)?
0
0

Related questions

0 votes
0 votes
1 answer
1
Rustam Ali asked in Programming in C Aug 24, 2018
258 views
Rustam Ali asked in Programming in C Aug 24, 2018
258 views
0 votes
0 votes
3 answers
2
Rustam Ali asked in Programming in C Aug 24, 2018
349 views
Rustam Ali asked in Programming in C Aug 24, 2018
349 views
0 votes
0 votes
1 answer
3
Rustam Ali asked in Programming in C Aug 24, 2018
1,312 views
Rustam Ali asked in Programming in C Aug 24, 2018
1.3k views
1 vote
1 vote
0 answers
4