Computer Science, asked by harsinis98, 1 year ago

In C program ‘&’ is used in ‘scanf’ to indicate

Answers

Answered by hellominigarg
0

When we use ‘&’ in ‘scanf’ in C program then it helps to find the address / location of stored element/data.

Basically, we can say that this is used for the purpose of finding the address of the element that is stored in the code. Due to its nature, it is also called address-of operator.

Answered by franktheruler
0

Answer:

In c programming language ' & ' is used in ' scanf' to indicate the address of the variable Or an another way we can say '&' operator is used within 'scanf' when we take a input from user. Now we understand this operator by an Example.

example program :

#include < stdio. h >

void main ( )

{

 int a, b, c ;

 printf ( " enter the value of a " ) ;

 scanf ( " % d " , & a ) ;  // here we use & operator to take input from user.

 printf ( " enter the value of b " ) ;

 scanf ( " % d " , & b ) ; // & operator.

  c = a + b ;

 printf ( " %d " , c ) ;

}

Similar questions