CH 2.B PROGRAMS/INSTRUCTIONS IN C Flashcards

(60 cards)

1
Q

Define c program.

A

c program is a collection of functions supported by c library

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

state the use of following in program:

main()

A

main is an function in program which states the line from which the execution of program begins. every program must has main function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

every program consist atleast one function in program and that function has to be ____.

A

main()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

state the use of following in program:

{}

A

{ brace bracket. denotes start of the function main. } denotes end of the function main(). includes instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
state the use of following in program: 
//
A

comment lines. non executable statements which are been ignored by the compiler. used for better understanding of the program by the compiler. helps in debugging and testing a program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

program within {} is called the ____.

A

body of function main()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

main() body contains ___.

A

instructions to perform a task

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

true or false: comment lines can be nested

A

false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

true or false: comment lines can be placed anywhere in the program

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

true or false: /* */ is used to write comment over one line.

A

false. // is used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

____ must end with a semicolon

A

statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

____ is a executable function used for printing the output in the program.

A

printf()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

___ ,___are a predefined function

A

printf()

scanf()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is an predefined function?

A

functions which are already been written nd compiled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

state the use of following in program: /n

A

backslash character constant which prints the output on nextline

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

true or false: the statements in c must be in specific order/position

A

false. c program can be in any position/order.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

c programs can be in uppercase, lowercase. but lowercase letters are for ___

A

symbolic constants

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

c programs must be in ___

A

lowercase

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

a c program must be written in ___ os and compiled in ___ compiler while executing a program in PC

A

msdos,dos

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

a program must be created and edited in any wordprocessing application in ___ mode.

A

non document

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

one must run a program file with ___ extension

A

.c

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

sucessful compilation will generate _____ of your program.

A

object file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

while compiling a program, c compiler points out(reports) ___.

A

syntax errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

state the process of execution of the program.

A
  1. the program is been written. a program can be written and edited in any word processing document in non document mode.
  2. the program is been debugged
  3. program is been compiled
  4. object file of the program is been generated
  5. object file is been linked to execution file and file has .exe extension.
  6. . program is been run the program file now has .c extension. the program can be run in msdos file by typing the name.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
write program for following: a basic c program
. refer txtbook
26
write program for following: a program stating the use of backslash character constants.
. refer txtbook
27
write program for following: a program using arithmetic operators (-,+,*,/,%)
. refer txtbook
28
write program for following: program using relational operators.
refer txtbook
29
write program for following: program using logical operators
refer txtbook
30
write program for following: program using increment and decrement operators
refer txtbook
31
write program for following: program using conditional operators
refer txtbook
32
write program for following: program using bitwise operators
refer txtbook
33
write program for following: program using sizeof() OR a program to show the memory size of int,float and char datatypes with subtypes like short,long...
refer txtbook
34
write program for following: to calculate the area of square, rectangle, circle by taking values from user.
refer txtbook
35
write program for following: performing integer arithmetic instructions
refer txtbook
36
write program for following: performing real arithmetic
refer txtbook
37
write program for following: performing mixed mode arithmetic
refer txtbook
38
write program for following: using symbolic constants
refer txtbook
39
write program for following: input the maximum temperature recorded in a day and calculate the avg temperature of the day
refer txtbook
40
write program for following: convert temperature (fahreinheit) into celcius
refer txtbook
41
write program for following: convert distance metres into cm
refer txtbook
42
write program for following: take input in ist and print the current est time
refer txtbook
43
write program for following: interchange 2 int values a,b
refer txtbook
44
write program for following: to calculate SI
refer txtbook
45
__ is denoted as post decrement of y. if value is 19. what would be the value.
y--
46
State whether the following are True or False 1. Welcome” is a string constant. 2. 24676 is a int constant 3. you.2 is a valid variable 4. an identifier must begin with character
1. true 2. true 3. false . 4. false variable
47
are foll valid variable names in c: 1. _pq 2. min_temp 3. 3s 4. add12
1. no 2. yes 3. no 4. yes
48
state whether the foll declarations are valid; | int a="PQ";
NO
49
state whether the foll declarations are valid; | p=12, float;
NO
50
state whether the foll declarations are valid; int a,b
NO SEMICOLON
51
state whether the foll declarations are valid; int a=10,n,r;
yes
52
float p,w,int r,s;
no
53
__ is bitwise and
refer txtbook
54
__ is bitwise or
refer txtbook
55
__ is bitwise exclusive or
refer txtbook
56
<< is a bitwise operator and does ___
refer txtbook
57
>> is a bitwise operator and does ___
refer txtbook
58
~ is a bitwise operator and does ___.
refer txtbook
59
state the output for foll: | txt book 39
refer txtbook
60
state the values in variables: txtbook 43
refer txtbook