what is the output for the code :
main()
{
int i,j;
printf("%d %d ",scanf("%d%d",&i,&j));
}
Answers were Sorted based on User's Feedback
Answer / tasneemuddin
The result of this program will be:
you have to enter two int numbers
output : 2 <the last number entered>
| Is This Answer Correct ? | 12 Yes | 6 No |
Answer / nani
The result of this program will be:
you have to enter two int numbers
output : 2 <the last number entered>
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sha
The first output would be the number of values scanned by
scanf, i.e. 2. I compiled the code and the second output
seems to be the address the second input given by user.
Input: 4 5
Output: 2 1242772
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / carol
scanf will return the number of arguments that are scanned
successfully from keyboard.So first it will get two values
from the user and return two . So the printf statement
prints 2 for the first %d and since there is no specific
value for second %d it will print garbage value.
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / varun
The Console will wait for two integer inputs.
After giving any two integer values, it will
return two values
1) no. of input i.e 2
2) Address of the first integer.
e.g
I have tested it with input-> 1,1 ; 2,9; 3,5; etc.....
For all it returns 2 3457158
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / suraj verma
It will return number of arguments taken
by scanf function which is two in this case
& the other value can be any garbage value.
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / vaibhav
the output will be
2(no. of inputs) <last number entered>
| Is This Answer Correct ? | 2 Yes | 4 No |
Answer / aarti dhiman
When we compile this program then 1 warning shows that the
function should return the value
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / prashant sharma
first the computer will take the two values as inputs &
then will show junk value
| Is This Answer Correct ? | 1 Yes | 4 No |
Explain how are 16- and 32-bit numbers stored?
shorting algorithmS
What are dangling pointers in c?
What is the role of this pointer?
Write a code to generate a series where the next element is the sum of last k terms.
What are structure types in C?
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
4) Write a program that takes a 5 digit number and calculates 2 power that number and prints it. i have done maximum par but i m findind problem in the commented area. please help...
When the macros gets expanded?
FIND THE OUTPUT IF THE INPUT IS 5 5.75 void main() { int i=1; float f=2.25; scanf("%d%f",&i,&f); printf("%d %f",,i,f); } ANSWER IS 5 AND 2.25 WHY?
Why is c faster?
Where does the name "C" come from, anyway?