C-Command Line Arguments
C-Command Line Arguments
31. fclose () function can
- Closes the stream
- Flushes all unwritten data from the stream.
- Discard all unread buffered input and free all allocated buffer.
- All of the above
32. If an error occurs during closing of a file then fclose () returns
- EOF
- Zero
- File pointer
- None of these
33. File I/O functions
- Contains functions to receive input from KB and write output to VDU.
- Contains functions to perform I/O operations on hard disk.
- Contains functions similalr to all operating system.
- All of the above
34. Find the output
#include "stdio.h"
void main ( )
{
int i=5;
char x='x';
float y=3.9;
char str[20];
sprint(str,"%d %c %f",i,x,y);
printf("%s",str);
}
#include "stdio.h"
void main ( )
{
int i=5;
char x='x';
float y=3.9;
char str[20];
sprint(str,"%d %c %f",i,x,y);
printf("%s",str);
}
- x
- 5 x 3.9
- 5 x 3.90000
- Compilation error
35. The commonly used functions for writing to a text stream are
- putc( )
- fputc( )
- fputs( )
- All of the above
36. in UNIX, file protection can be assigned at
- user level
- Group level
- Other
- All of the above
37. The sector size of a disk working in MS DOS envoronment is
- 512 bytes
- 256 bytes
- 1024 bytes
- None of these
38. The function read ( ) returns
- Actual number of bytes transferredon successful reading
- -1 if an EOF is found
- 0 if an error occurs.
- All of the above
39. Find out the output
#include "fcnt1.h"
#include"sys\stat.h"
void main ( )
{
int x;
x=open ("raja.txt",
0_CREAT | _TEXT, S_TWRITE);
printf ("%d", k);
}
#include "fcnt1.h"
#include"sys\stat.h"
void main ( )
{
int x;
x=open ("raja.txt",
0_CREAT | _TEXT, S_TWRITE);
printf ("%d", k);
}
- 5
- 6
- 7
- None of these
40. State the correct statement.
- fseek() only works with file handler
- Iseek() only works with file pointer
- close() closes the file pointer
- None of these