没有合适的资源?快使用搜索试试~ 我知道了~
题四:Input and Output Floating Point & Sizeof Operator1
需积分: 0 0 下载量 160 浏览量
2022-08-08
17:58:38
上传
评论
收藏 196KB DOCX 举报
温馨提示
试读
40页
英文题库C目录1. Data Types, Operators and Expressions 1 Variable Names – 1 1 Data Type
资源详情
资源评论
资源推荐
i
英文题库 C
目录
1. Data Types, Operators and Expressions .................................................................................1
Variable Names – 1 ...................................................................................................................1
Data Types and Sizes – 1...........................................................................................................3
Constants – 1 ............................................................................................................................6
Declarations – 1 ......................................................................................................................10
Arithmetic Operators – 1 ........................................................................................................14
Relational & Logical Operators – 1 .........................................................................................17
Type Conversions – 1 ..............................................................................................................20
Increment and Decrement Operators – 1...............................................................................23
Bitwise Operators – 1 .............................................................................................................26
Assigment Operators & Expressions – 1 .................................................................................29
Conditional Expressions – 1 ....................................................................................................32
Precedence and Order of Evaluation – 1 ................................................................................35
Precedence and Order of Evaluation – 2 ................................................................................40
Precedence and Order of Evaluation – 3 ................................................................................44
2. Control Flow Statements .....................................................................................................48
If-then-else Statements – 1 ....................................................................................................48
Switch Statements – 1 ............................................................................................................53
For Loops – 1...........................................................................................................................58
While Loops – 1.......................................................................................................................61
Break and Continue – 1...........................................................................................................65
Goto & Labels – 1....................................................................................................................68
3. Functions and Structure of a Program..................................................................................72
Basics of Functions – 1............................................................................................................72
Functions Returning Non-integers – 1 ....................................................................................76
External Variables – 1 .............................................................................................................79
Scope of a Variable – 1 ...........................................................................................................83
Static Variables – 1..................................................................................................................86
Register Variables – 1 .............................................................................................................89
Automatic Variables – 1..........................................................................................................92
C-Preprocessor – 1..................................................................................................................94
File Inclusion – 1 .....................................................................................................................96
Macro Substitution – 1 ...........................................................................................................99
Conditional Inclusion – 1.......................................................................................................103
4. Pointers and Arrays ...........................................................................................................106
Pointers and Addresses – 1...................................................................................................106
Pointers and Function Arguments – 1 ..................................................................................109
Pointers and Arrays – 1.........................................................................................................114
Address Arithmetic – 1 .........................................................................................................117
Character Pointers and Functions – 1...................................................................................120
ii
Pointers to Pointers – 1 ........................................................................................................124
Multidimensional Arrays – 1.................................................................................................127
Initialization of Pointer Arrays – 1 ........................................................................................130
Pointers Vs. Multi-dimensional Arrays – 1............................................................................133
Command Line Arguments – 1..............................................................................................136
Pointers to Functions – 1 ......................................................................................................138
Complicated Declarations – 1 ...............................................................................................142
5. Structures, Unions and Bit-Fields .......................................................................................148
Basics of Structures – 1.........................................................................................................148
Structures and Functions – 1 ................................................................................................152
Arrays of Structures – 1 ........................................................................................................155
Pointer to Structures – 1.......................................................................................................159
Self-Referential Structures – 1..............................................................................................164
Table Lookup – 1...................................................................................................................168
Typedefs – 1..........................................................................................................................172
Unions – 1 .............................................................................................................................176
Bit-fields – 1 ..........................................................................................................................179
6. Input and Output ...............................................................................................................182
Standard Input & Output – 1 ................................................................................................182
Formatted Output – 1...........................................................................................................184
Variable Length Argument – 1 ..............................................................................................187
Formatted Input – 1..............................................................................................................189
File Access – 1 .......................................................................................................................192
Error Handling – 1.................................................................................................................194
Line Input & Output – 1 ........................................................................................................197
String Operations – 1 ............................................................................................................200
Character Class Testing & Conversions – 1 ...........................................................................203
Ungetc – 1.............................................................................................................................206
Storage Management – 1 .....................................................................................................209
Mathematical Functions – 1 .................................................................................................211
Random Number Generation – 1..........................................................................................214
7. Floating Point & Sizeof Operator........................................................................................216
Float Datatype – 1.................................................................................................................216
Sizeof – 1...............................................................................................................................218
1
6. Input and Output
Standard Input & Output – 1
1. Which among the following is odd one out?
a) printf
b) fprintf
c) putchar
d) scanf
View Answer
Answer:d
2. For a typical program, the input is taken using.
a) scanf
b) Files
c) Command-line
d) None of the mentioned
View Answer
Answer:d
3. What does the following command line signify?
prog1|prog2
a) It runs prog1 first, prog2 second
b) It runs prog2 first, prog1 second
c) It runs both the programs, pipes output of prog1 to input of prog2
d) It runs both the programs, pipes output of prog2 to input of prog1
View Answer
Answer:c
4. What is the default return-type of getchar()?
a) char
b) int
C. char *
D. Reading character doesn’t require a return-type
View Answer
Answer:b
5. The value of EOF is_____.
a) -1
b) 0
c) 1
d) 10
View Answer
Answer:a
2
6. What is the use of getchar()?
a) The next input character each time it is called
b) EOF when it encounters end of file.
c) Both a & b
d) None of the mentioned
View Answer
Answer:c
7. Which is true?
a) The symbolic constant EOF is defined in
b) The value is typically -1,
c) Both a & b
d) Either a or b
View Answer
Answer:c
8. What is the use of putchar()?
a) The character written
b) EOF is an error occurs
c) Nothing
d) Both a & b
View Answer
Answer:d
3
Formatted Output – 1
1. What is the output of this C code?
1. #include <stdio.h>
2. int main()
3. {
4. int i = 10, j = 2;
5. printf("%d\n", printf("%d %d ", i, j));
6. }
a) Compile time error
b) 10 2 4
c) 10 2 2
d) 10 2 5
View Answer
Answer:d
2. What is the output of this C code?
1. #include <stdio.h>
2. int main()
3. {
4. int i = 10, j = 3;
5. printf("%d %d %d", i, j);
6. }
a) Compile time error
b) 10 3
c) 10 3 some garbage value
d) Undefined behaviour
View Answer
Answer:c
3. What is the output of this C code?
1. #include <stdio.h>
2. int main()
3. {
4. int i = 10, j = 3, k = 3;
5. printf("%d %d ", i, j, k);
6. }
a) Compile time error
b) 10 3 3
c) 10 3
d) 10 3 somegarbage value
View Answer
Answer:c
剩余39页未读,继续阅读
苗苗小姐
- 粉丝: 37
- 资源: 328
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0