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 |
A.C func() { pritnf(" in fuction %d",MACRO); } MAIN.c testfunc() { #define MACRO 10 printf("in test function %d", MACRO); } main() { printf("in main %d",MACRO); func(); testfunc(); getch(); }
What type of function is main ()?
What are the back slash character constants or escape sequence charactersavailable in c?
Efficient data structure for store/search list of 1000 records a)array b)double linked list c)circular queue d)hash table
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
What are data types in c language?
WHAT IS MAXIMUM SIZE OF AN ARRAY IN C LANGUAGE?
8 Answers Carphone Warehouse, IBM, SAS,
x=2,y=6,z=6 x=y==z; printf(%d",x)
13 Answers Bharat, Cisco, HCL, TCS,
How can you return multiple values from a function?
Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors
write c program to display output 10(10+20)+(10+20+30)+ ... n term
0 Answers Hindustan Gum Chemicals,
How do i store a paragraph into a string? for example, if i input a long paragraph, the program will read the words one by one and concatenate them until no word is left.