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

what is Structural oriented language? give some example of this language.....?

1 Answers  


What is volatile variable how do you declare it?

0 Answers  


How can I sort a linked list?

0 Answers  


. 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.

1 Answers  


What is wrong in this statement?

0 Answers  


c program to manipulate x=1+3+5+...+n using recursion

2 Answers   Wipro,


#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??

0 Answers  


What is the difference between ++a and a++?

0 Answers  


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

3 Answers  


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; ?

3 Answers  


what will be printed by this printf? printf("%c",printf("hi")["sharkselva"])); }

3 Answers   HCL,


Categories