What is the purpose of & in scanf?



What is the purpose of & in scanf?..

Answer / Sameer Kumar Srivastava

The ampersand (&) symbol in C's scanf function is used to take the address of a variable. This allows scanf to store the input data into that specific memory location.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

1 Answers  


Evaluate the following: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); 1) 10 2) 11 3) 1

6 Answers  


2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier. &#61550; Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed. &#61550; When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed. &#61550; Sequence of take-off is the sequence of addition to the waitlist

1 Answers  


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

1 Answers   Wilco,


while initialization of two dimensional arrays we can initialize like a[][2] but why not a[2][] is there any reason behind this?

4 Answers   Aptech,


What's wrong with "char *p; *p = malloc(10);"?

5 Answers  


write a program to find out prime number using sieve case?

0 Answers   HCL,


to find out the reverse digit of a given number

6 Answers   Infosys, Microsoft, TCS, Wipro,


Is it better to use malloc() or calloc()?

1 Answers   Aspire, Infogain,


if we take a number as a char then can we manipulate(add, subtract) on this number

2 Answers  


what is the maximum limit of row and column of a matrix in c programming. in linux .

4 Answers   NIIT,


My teacher ask to make a program that can: Insert record in front Insert record at the end Insert in between Search node record Delete record in front Delete record at the end Delete record in between Using Data structure Linked List type. But I'm really confused about the codes and I can't go through. Please help Thanks in advance. Also here is my unfinished code if someone can make changes it will be more good.

1 Answers  


Categories