answersLogoWhite

0


Best Answer

Hiii,

scanf() is an predefined function of C to getting runtime input from the user.

Syntax:-

scanf("sequence specifier",&variable_name);

example:-

#include

void main()

{

int number;

printf("\n Enter any number"); //message to user

scanf("%d",&number); //getting input from user

printf("\n entered number is %d",number); // display

getch();

}

User Avatar

Wiki User

9y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

scanf is a c library function .input data cant be entered into the computer from standard input device by means of c library function scanf.

printf is an output function.it is used to display any combination of numerical values,single character and strings.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

Scanf is used to get input from the user, it could be thought of as the opposite of printf.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

scanf is used to store the address of the variable.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

1. scanf isn't a statement; it's a function.

2. &x means the address of x

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

because during running program data can be enter in programmed by user

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Reading formatted data from stdin. Use the manual/help.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the use of scanf function in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Scanf function in c for strings?

Use '%s', eg: char name[64]; scanf ("%s", name);


What is difference between scanf and cin?

scanf is a function (available in C and C++)cin is an istream object (C++ only)Advice: when in doubt, use fgets+sscanf


What happens by the scanf statement in c?

It's a function, not a statement. Use your help system to find out its purpose.


Is there a function similar to the C plus plus scanf function in JavaScript?

Scanf is part of the C standard library. Although the C++ standard library includes 18 headers from the ISO C90 standard, their usage in C++ is deprecated. However, to answer the question, there is no equivalent to scanf in JavaScript.


How do you read a character from the keyboard and will store it in the variable?

Use the scanf() function from the C standard library.


Can you use scanf function within printf function?

Yes: double d; printf ("scanf's just returned %d\n", scanf ("%lf", &d));


Why not use the ampression symbol in scanf statement in function?

scanf is a function, not a statement. Example: int a; char name[12]; scanf ("%d %s", &a, &name[0]);


How do you give input at run time in c?

Usually by using the scanf function


Which function is used to read data from the console?

The scanf() function in the <stdio.h> C standard library header.


What is standard library function in c?

The Standard Librarary Function in C is printf,scanf inf Standard input output header.. which is stdio.h.


What is return type of scanf function?

Use the help/manual.


Why do you use scanf in c?

To read input from standard input.