0% found this document useful (0 votes)
64 views11 pages

PPS Bit Bank-2

The functions fseek() and ftell() are used to position a file at the beginning or get the current position. Call by value does not change the actual argument values. The 'b' flag in file opening modes indicates a binary file. The keyword to define a structure is 'struct'. If a file fails to open, fopen() returns a null pointer. A structure member is accessed using the dot (.) operator. The number of command line arguments is the first argument to main(). A pointer to a structure uses the arrow (->) operator. Bit fields allow float, double, long double, and unsigned int. A structure is a derived data type. The value assigned to the enum constant FRI is 8. The

Uploaded by

hello
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views11 pages

PPS Bit Bank-2

The functions fseek() and ftell() are used to position a file at the beginning or get the current position. Call by value does not change the actual argument values. The 'b' flag in file opening modes indicates a binary file. The keyword to define a structure is 'struct'. If a file fails to open, fopen() returns a null pointer. A structure member is accessed using the dot (.) operator. The number of command line arguments is the first argument to main(). A pointer to a structure uses the arrow (->) operator. Bit fields allow float, double, long double, and unsigned int. A structure is a derived data type. The value assigned to the enum constant FRI is 8. The

Uploaded by

hello
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

BIT BANK : UNIT 3,4,5

1 The function that is used to position a file feof( ) fclose() ftell( ) fseek( )
at the beginning is.

In which parameter passing Call by By value Call by value reference Call by byname call by by
2 mechanism, actual argument values reference
are unchanged?

3 If the mode includes b after the initial text file big text file binary file blueprint text
letter, what does it indicates?

4 Standard error stream is called error stderr stdio None

5 The keyword used to define a stru struct structure STRUC


structure is

6 If the file was not able to be opened, then the Null non-empty empty None
value returned by the fopen() routine
is
7 The operator used to access the * & .(Dot) |
structure member is

BIT BANK UNIT 3,4,5


8 In command line arguments program the Number of parameters type of parameters Parameter Values None
first argument of the main function supplied at command supplied at command
Indicates
prompt prompt
9 The operator exclusively used with . [] arrow(->) *
pointer to structure is
long double float double unsigned int
10 Which of the data types are accepted while
declaring bit-fields?
11 Which of the following is correct for a Scalar data type Derived data type Enumerated type Null Type
Structure definition?

12 In enum wd={SUN, MON, TUE=5, WED, 6 7 8 9


THU, FRI, SAT}, The value Assigned
to enum constant FRI is -------------

13 The equivalent function to rewind(fp) is---- fseek(fp,0L,2) fseek(fp,0L,0) ftell() fseek(fp,4L,1)


-------
14 When accessing a structure member, the structure member The structure tag A structure variable The keyword struct
identifier to the left of the dot operator is
15 What is the keyword used to define a C def definition define
macro.? defy

16 What is the output of the program?


#include<stdio.h>
#define K 2+3
int main() 8 9 5 11
{
printf("%d",K);
return 0;
}

17 When a structure is an element to


another structure, it is called as a Structure within a
Union structure Pointer to Structure Array of Structures

BIT BANK UNIT 3,4,5


Opens the file and
Opens the file and reads Erases the old content Results an error
appends the new content
18 Opening a file that exists in the system the content from the file and allows for writing message “File Already
to the existing content
with write mode? new content Exists”

Structure is a data type whose members may be different or


19 all different data types all same data types no element is defined
are same
20 Dynamic memory Static memory
A program obtaining its memory while it is Stack memory allocation None
running is called as allocation allocation

21 Which of the following is not a Standard stdin stdout stderr stdfile


Stream?
22

23 Which of the following is used with printf ( %d %u %f %c


)function for printing the Address of a
variable
24 A structure is one which contains a Self-referential Nested Array Pointer
pointer to its own type
25 Struct 4bytes 2 bytes 6 bytes 0 bytes
{
int i;
flaot j;
} s;

sizeof (s) will be

26 The process of calling a function using call by argument call by parameter call by value call by reference
pointers to pass the address of variables is
known as

28 main() a=3,b=3 a=4,b=4 a=6,b=6 a=5,b=5


{
int a=5,b,*c;
c=&a;

BIT BANK UNIT 3,4,5


b=*c;
printf("\n value of a=%d & b=%d",a,b,)
}

29 In C language the Bit fields are used to Save time Save memory ) Change order of Save Program
allocation of memory

30 A block of memory is allocated using the falloc() dalloc( ) malloc() calloc( )


function
31 The size of structure and union is Single member any number of Arrays of different types Pointers to
same when they contain members different types

32 The operator used to find the size of sizeof() sizof() size of() size()
any variable

33 In union all members use No location same location Different location No stroage

The arguments which are passed to main Command line Actual arguments Format arguments None
34
() function are known as arguments
In --------- One or more members are Nested structure Self-referential
35 Array of structures Unions
referencing same type structure

37 union sample
{
Int a;
Float b; 4bytes 7 bytes 8 bytes 6 bytes
Char c;
}s;
Sizeof(s) is

BIT BANK UNIT 3,4,5


One structure cannot be a member of Some other an array a union the same structure
38
structure
The type of any pointer is integer data type character datatype unsigned integer none of these
39
data type
40 The size of union is equal to-------------- The size of largest The size of smallest sum of the sizes of all average sizes of all
member member members members
Structure is a data type whose members may be different or
41 all different data types all same data types no element is defined
are same
42 ------- is/ are file positioning functions ftell() fseek() rewind() All

43 ‘C‘ provides a facility for user defined Array Function Pointer Structure
data type using
concept

44 ---------- is /are file status function feof() ftell() fseek() All

45 In C language the expression(*ps).x is ps->x x->ps ps->*x NONE


equal to

46 Which mode is used to open a file in read r r+ rb w


and write mode?
-------Operator is used to access the *(astric) &(ampersand) →(defines) .(dot)
47
members of the structure?
48 Which function is used to close a file? close() end() stop() fclose()
49 Which of the following is a list of
named integer constants? typedef enumeration structure union

50 How many arguments that the strcmp() 2 3 4 0


function can take?

BIT BANK UNIT 3,4,5


If the file abc.txt is File abc.txt is only
Choose a correct statement about C file found, fopen If the file abc.txt is opened in Read Mode.
51 "r" mode operation using fopen.
returns a FILE not found, fopen Now read operation is
fopen("abc.txt","r"); ALL
pointer. returns NULL or 0. performed.

52 Which of the following is a memory


location that is shared by two or
more different types of variables? typedef enumeration structure union

Move 5 characters in Move 5 characters in back Move 5 characters in Move 5 characters in


fseek(fp,-5L,1) backward direction from ward direction from end of forward direction from forward direction from
53 current byte file current position beginning

54 argv[0] points to Program name First argument Both none

addition of a number to a subtraction of two subtraction of a number


Which of the following operations is not addition of two pointers
55 pointer pointers from a pointer
performed on pointers?
A region of storage
56 Which of the following is true about a It is a data type A variable Pointer
in Disk
File in C?

If the function fopen() fails, it returns


-1 1 NULL Address
57

Which function adds a string to the end of


58 another string? stradd() strcat() strtok() strcpy()

putw()
59 The function used for writing a character putc() fputs() fputchar()
to a file is

BIT BANK UNIT 3,4,5


structure variable structure declaration structure variable
Memory for a structure is allocated at the structure definition
60 declaration definition
time of
61 The function used for reading a
formatted input data from a file is getchar() fscanf() fgetc() fgets()

62 function set the pointer position rewind()


anywhere in the data file fseek() feof() ftell()

63 The mode used for opening an existing


file for reading a binary stream is r rb wb w

self-referential
A structure can be placed within another nested structure Parallel structure pointer
64 structure and is known as structure

Which of the following is used to create a


65 new data type name for an existing data enum struct union typedef
type?
66 What will be the output of the following C 10 11 9 12
code?
#include<stdio.h> main()
{
typedef int a; a
b=2, c=8, d;
d=(b*2)/2+8;
printf("%d",d)
;
}

67 Which of the following is used to create a enum struct union typedef


new data type name for an existing data
type?

BIT BANK UNIT 3,4,5


68 The mode used for opening an existing r+ r w+ w
file for reading & writing a text
stream is

needs 2 arguments makes rewind takes 3 arguments none of the above


69 In C, file processing function fseek() function
unnecessary

70 What is the output of this program? -1 0 4 5 6 7 -1 0 1 2 3 4 012345 Error

#include <stdio.h>
int main()
{
enum days {MON=-1, TUE, WED=4,
THU, FRI, SAT};
printf("%d, %d, %d, %d, %d, %d",
MON, TUE, WED, THU, FRI, SAT);
return 0;
}

Structure elements can be accessed through *(astric) &(ampersand) →(defines) .(dot)


71 a pointer to a structure using the
operator
72 rewind() function takes number of 1 2 3 0
arguments
Dynamic memory Static memory
A program obtaining its memory while it is Stack memory allocation None
73 running is called as allocation allocation

fseek(fptr,0L,0) is equivalent to ftell() rewind() A&b none


74

Pre-Processing statements are started


75 with -------- symbol & * # @

BIT BANK UNIT 3,4,5


The pointer stores ------------- of a
76 variable Value Address Both None

Which among the following is odd


one out? printf() fprintf() putchar() scanf()
77

78 -----------is/are cannot be applied on pointer arrays Static All of the above


bitfields
What is the type of argument vector(argv[])
79 in command line arguments int * char * float * double *
?
80 End of File is represented by ‘\0’ NULL EOF END

A structure tag declared One of the basic Pointer to the It is a type name
in stdio.h datatypes in c structure defined in stdio.h
FILE reserved word is defined in
81
stdio.h

rewind () function brings file pointer to --


82 --------------- End of the file Required byte Middle of the file Beginning of the file

Failure to
Trying to read a allocate
83 Which of the following causes an error file that doesn‘t Inability to write
memory with
exist data in a file. ALL of the above
the help of
malloc

Which of the following keywords is used to default volatile typedef static


define an alternate name for an already
84 existing data type?

BIT BANK UNIT 3,4,5


fputs adds newline character true false Depends on the Undefined behavior
85 standard
86 In fseek() function , the position value 2 Beginning of file End of file Current position All
indicates

87 The keyword that is used to declare Union Struct Enum typedef


structures is
Which of the following are C #ifdef #define #endif All
preprocessors?
88

In fseek() function , the position value 1 Beginning of file End of file Current position All
89 indicates

The operator used to get value at * & && ||


86 address stored in a pointer variable is

What would be the equivalent pointer ((((a+i)+j)+k)+l) *(*(*(*(a+i)+j)+k)+l) (((a+i)+j)+k+l) ((a+i)+j+k+l)


expression for referring the array
87 element a[i][j][k][l]

Which function is used to search for a strchr strstr strspn strcpy


substring in a string?
88

How many arguments that the 2 3 4 0


strcmp() function can take?
89

Comma Full stop Semicolon Null character


A string constant is one dimensional (“\0”)
90 array of characters terminated by a

BIT BANK UNIT 3,4,5


fseek() feof() ferror() ftel()
The ------------- function in C is used
91 to check if the end of file has been
reached.
92 -------------- is generic pointer int * float* void * char *

93 -------------is/are type qualifiers const restrict volatile all

94 ftell() function returns ----------------------- int float char long int

95 The name of the array refers to----- base last middle none
address

BIT BANK UNIT 3,4,5

You might also like