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 |
what is Structural oriented language? give some example of this language.....?
What is volatile variable how do you declare it?
How can I sort a linked list?
. A database table called PERSON contains the fields NAME, BASIC and HRA. Write a computer program to print a report which employee name and total salary for those employees whose total salary is more than 10,000. Total Salary = BASIC + HRA. At the end, the program should also print the total number of employees whose total salary is more than 10,000.
What is wrong in this statement?
c program to manipulate x=1+3+5+...+n using recursion
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
What is the difference between ++a and a++?
Tell me a C program to display the following Output? 1 1 1 1 1 2 2 2 2 3 3 3 4 4 5
What is the output of the program given below #include<stdio.h> main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
21 Answers ADITI, Student, TCS,
What's the difference between struct x1 { ... }; and typedef struct { ... } x2; ?
what will be printed by this printf? printf("%c",printf("hi")["sharkselva"])); }