Program to write some contents into a file using file
operations with proper error messages.
Answer Posted / manvitha
//writing into a file
main()
{
char c;
FILE *fp;
fp=fopen("infor.dat",'w');
printf("enter data \n enter tab & enter a stop\n");
do
{
c=getchar();
put c(c,fp);
}while(c!='\t');
fclose(fp);
getch();
}
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
What is difference between class and structure?
What are derived data types in c?
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above
Explain how do you generate random numbers in c?
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
What is data types?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
What is queue in c?
Who invented b language?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
What will be your course of action for a push operation?
What is structure pointer in c?
What is array within structure?
What is a union?