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
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 |
Answer / vivek
it will produce an error as constant cant be added to a pointer
Is This Answer Correct ? | 1 Yes | 4 No |
How can I pad a string to a known length?
Tell me with an example the self-referential structure?
What are the advantages of using macro in c language?
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.
Who is invented by c?
a character variable can at a time store a) 1 character b) 8 characters c) 254 characters d) none of the above
What is data types?
who is first prime minister in india??
write a program to concatenation the string using switch case?
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.
Program to find the sum of digits of a given number until the sum becomes a single digit
write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]