What is the difference between scanf and fscanf?



What is the difference between scanf and fscanf?..

Answer / Amit Shukla

The main difference between scanf and fscanf is that scanf reads input from the standard input stream (keyboard), while fscanf reads input from a specified file. Both functions convert formatted input to variables.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What is #define in c?

1 Answers  


What will be the result of the following C language program? main() { int a = 0; int b = 20; char x = 1; char y = 10; if(a,b,x,y) printf("Welcome"); }

1 Answers  


What are macros in C?

2 Answers  


1. Can we use the for loop this way? for(;i>5;) 2. What is the use of pointers? 3. what is array of pointer? 4. What is the difference between file and database? 5. Define data structure?

1 Answers  


Explain output of printf("Hello World"-'A'+'B'); ?

1 Answers  


can we declare a function in side the structure?

2 Answers   HCL,


12345 1234 123 12 1

2 Answers  


Differentiate between Macro and ordinary definition.

1 Answers   Motorola,


What is the size of array float a(10)?

1 Answers  


YBJBU6

1 Answers  


What is the use of getchar() function?

1 Answers  


How can a program be made to print the line number where an error occurs?

1 Answers  


Categories