CH 2.B PROGRAMS/INSTRUCTIONS IN C Flashcards

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
Q

write program for following: a basic c program

A

. refer txtbook

26
Q

write program for following: a program stating the use of backslash character constants.

A

. refer txtbook

27
Q

write program for following: a program using arithmetic operators (-,+,*,/,%)

A

. refer txtbook

28
Q

write program for following: program using relational operators.

A

refer txtbook

29
Q

write program for following: program using logical operators

A

refer txtbook

30
Q

write program for following: program using increment and decrement operators

A

refer txtbook

31
Q

write program for following: program using conditional operators

A

refer txtbook

32
Q

write program for following: program using bitwise operators

A

refer txtbook

33
Q

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…

A

refer txtbook

34
Q

write program for following: to calculate the area of square, rectangle, circle by taking values from user.

A

refer txtbook

35
Q

write program for following: performing integer arithmetic instructions

A

refer txtbook

36
Q

write program for following: performing real arithmetic

A

refer txtbook

37
Q

write program for following: performing mixed mode arithmetic

A

refer txtbook

38
Q

write program for following: using symbolic constants

A

refer txtbook

39
Q

write program for following: input the maximum temperature recorded in a day and calculate the avg temperature of the day

A

refer txtbook

40
Q

write program for following: convert temperature (fahreinheit) into celcius

A

refer txtbook

41
Q

write program for following: convert distance metres into cm

A

refer txtbook

42
Q

write program for following: take input in ist and print the current est time

A

refer txtbook

43
Q

write program for following: interchange 2 int values a,b

A

refer txtbook

44
Q

write program for following: to calculate SI

A

refer txtbook

45
Q

__ is denoted as post decrement of y. if value is 19. what would be the value.

A

y–

46
Q

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
A
  1. true
  2. true
  3. false .
  4. false variable
47
Q

are foll valid variable names in c:

  1. _pq
  2. min_temp
  3. 3s
  4. add12
A
  1. no
  2. yes
  3. no
  4. yes
48
Q

state whether the foll declarations are valid;

int a=”PQ”;

A

NO

49
Q

state whether the foll declarations are valid;

p=12, float;

A

NO

50
Q

state whether the foll declarations are valid; int a,b

A

NO SEMICOLON

51
Q

state whether the foll declarations are valid; int a=10,n,r;

A

yes

52
Q

float p,w,int r,s;

A

no

53
Q

__ is bitwise and

A

refer txtbook

54
Q

__ is bitwise or

A

refer txtbook

55
Q

__ is bitwise exclusive or

A

refer txtbook

56
Q

&laquo_space;is a bitwise operator and does ___

A

refer txtbook

57
Q

> > is a bitwise operator and does ___

A

refer txtbook

58
Q

~ is a bitwise operator and does ___.

A

refer txtbook

59
Q

state the output for foll:

txt book 39

A

refer txtbook

60
Q

state the values in variables: txtbook 43

A

refer txtbook