Explain this code.

#include <stdio.h>

void f1(int *k)
{
*k = *k + 10;
}

main ( ){
int i;
i = 0;
printf (" The value of i before call %d \n", i);
f1 (&i);
printf (" The value of i after call %d \n", i);
}

Answers were Sorted based on User's Feedback



Explain this code. #include <stdio.h> void f1(int *k) { *k = *k + 10; } main (..

Answer / pooja agarwal

10

Is This Answer Correct ?    11 Yes 0 No

Explain this code. #include <stdio.h> void f1(int *k) { *k = *k + 10; } main (..

Answer / ankita sharma

answer will be 10. as k has the address of i so when we write *k=*k+10; *k meand that value to which k is pointing so it is pointing to i and i has the value 0 as intial value so 10 would be added to the value of i. so output  will be 10.

Is This Answer Correct ?    0 Yes 0 No

Explain this code. #include <stdio.h> void f1(int *k) { *k = *k + 10; } main (..

Answer / vivek

it will produce an error as constant cant be added to a pointer

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More C Interview Questions

How can I pad a string to a known length?

0 Answers  


Tell me with an example the self-referential structure?

0 Answers  


What are the advantages of using macro in c language?

0 Answers  


Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.

2 Answers  


Who is invented by c?

24 Answers   Infosys, Mphasis,






a character variable can at a time store a) 1 character b) 8 characters c) 254 characters d) none of the above

3 Answers  


What is data types?

0 Answers  


who is first prime minister in india??

8 Answers   Wipro,


write a program to concatenation the string using switch case?

0 Answers  


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

0 Answers   IBM,


Program to find the sum of digits of a given number until the sum becomes a single digit

8 Answers   InterGraph,


write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]

7 Answers   Calsoft,


Categories