main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is:

a) Variable 'str' is not initialised

b) Format control for a string is not %s

c) Parameter to scanf is passed by value. It should be an address

d) none



main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above progr..

Answer / Amit Tiwari

a) Variable 'str' is not initialised

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What is bash c?

1 Answers  


Given an array of numbers, except for one number all the others occur twice. Give an algorithm to find that number which occurs only once in the array.

6 Answers  


what is the difference between structural,object based,object orientd programming languages?

1 Answers   PanTerra,


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

1 Answers  


What is meant by gets in c?

1 Answers  


What are the types of type qualifiers in c?

1 Answers  


What is hashing in c language?

1 Answers  


#include<stdio.h> { printf("Hello"); } how compile time affects when we add additional header file <conio.h>.

1 Answers  


What are header files in c?

1 Answers  


What is meant by initialization and how we initialize a variable?

1 Answers  


diff .between strcture and union

2 Answers  


List some applications of c programming language?

1 Answers  


Categories