Computer Fundamentals (Final Term)

studied byStudied by 28 people
0.0(0)
Get a hint
Hint

#include

1 / 73

74 Terms

1

#include

Instructs the C preprocessor to find the text file “stdio.h” or the standard input and output.

New cards
2

Comments (/* */)

May span any number of lines

New cards
3

Main

The most important. It defines the point at which your program starts to execute.

New cards
4

“{“

Means begin in Braces

New cards
5

“}”

Means end in Braces

New cards
6

“//”

A comment that only spans 1 line

New cards
7

Printf

Standard way of producing output.

New cards
8

“\n”

How C handles new lines. or “Enter”

New cards
9

Return

Causes the value to be passed back to the operating stem.

New cards
10

Return 0;

Means that the code is successful.

New cards
11

Return 1:

Means that the code failed.

New cards
12

True

Statements in the body are ended with semicolons “;”

New cards
13

True

Indention is ignored by the compiler (but it is important in programming)

New cards
14

True

C is case sensitive

New cards
15

True

Strings are placed in double quotes (“ “)

New cards
16

\t

Means tab or space

New cards
17

Data Type

Indicates the type of data that can be represented in the value of the data element.

New cards
18

int: integer

A whole number

New cards
19

float: floating point value

A number with a fractional part

New cards
20

double

A double-precision floating point value.

New cards
21

char (enclosed in ‘ ‘)

A single character

New cards
22

void

Valueless special purpose type

New cards
23

%d

int: integer

New cards
24

%f

float: floating point value

New cards
25

%lf

double

New cards
26

%c

char

New cards
27

%s

void

New cards
28

True

Local Variables must be declared after the “{“

New cards
29

True

Global Variables must be declared after the directives

New cards
30

True

Valid characters are letters, digits, and “__”

New cards
31

True

First character cannot be a digit

New cards
32

True

There are 31 character for local variables

New cards
33

True

There are 6 global variables

New cards
34

True

Name must relevant to its value

New cards
35

Constant

Retains a constant value throughout the execution of the program

New cards
36

Scanf

Gets an input value from the user

New cards
37

True

double r;

const double pi = 3.14159;

double a;

printf("\nEnter Radius Value:\t");

scanf("%lf", &r);

without the “&” the value will retain the generated random number during the declaration.

New cards
38

Operators

Used to perform operations on variables and values

New cards
39

Arithmetic Operators

Used to perform common mathematical operations

New cards
40

+

Addition

New cards
41

-

Subtraction

New cards
42

*

Multiplication

New cards
43

/

Division

New cards
44

%

Modulus

New cards
45

++

Increment

New cards
46

--

Decrement

New cards
47

Increment

Increases the value of an operand by 1

New cards
48

Decrement

Decreases the value of an operand by 1

New cards
49

Unary Operators

Only operates on a single operand

New cards
50

Assignment Operators

Used to assign values to variables

New cards
51

Comparison Operators

Compare two values (or variables)

New cards
52

Comparison Operators

Helps to find answers and make decisions

New cards
53

Comparison Operators

Return Value is either 1 for true and 0 for false. These are also known as “Booelan Values

New cards
54

==

Equal to

New cards
55

!=

Not equal to

New cards
56

>

Greater than

New cards
57

<

Less than

New cards
58

>=

Greater than or Equal to

New cards
59

<=

Less than or equal to

New cards
60

Logical Operators

Can test true or false. Used to determine the logic between variables/values

New cards
61

&&

Logical and — returns true if both are true

New cards
62

||

Logical or — returns true if one is true

New cards
63

!

Logical not — reverse, returns false is result is true

New cards
64

Operator Precedence

Determines the grouping of terms in an expression and decide how an expression is evaluated

New cards
65

<math.h>

Contains methods for performing mathematical operations

New cards
66

ceil (number)

Rounds up the given number

New cards
67

floor (number)

Rounds down the given number

New cards
68

sqrt (number)

Returns the square of the given number

New cards
69

pow (base, exponent)

Returns the power of the given number

New cards
70

abs (number)

Returns the absolute value of the given number

New cards
71

Type Casting

Converting one datatype into another

New cards
72

Implicit Type Casting

Converts the datatype to any variable without using the actual value.

New cards
73

Explicit Type Casting

Force the conversion between data types.

New cards
74

Advantages of Type Casting

  • makes the program very lightweight

  • type representation and hierarchies

  • helps programmers to convert one data type to another type

New cards

Explore top notes

note Note
studied byStudied by 243 people
... ago
5.0(1)
note Note
studied byStudied by 11 people
... ago
5.0(1)
note Note
studied byStudied by 3 people
... ago
5.0(1)
note Note
studied byStudied by 21 people
... ago
5.0(1)
note Note
studied byStudied by 252 people
... ago
5.0(6)
note Note
studied byStudied by 12 people
... ago
4.0(1)
note Note
studied byStudied by 86 people
... ago
5.0(1)
note Note
studied byStudied by 23409 people
... ago
4.5(104)

Explore top flashcards

flashcards Flashcard (81)
studied byStudied by 5 people
... ago
5.0(1)
flashcards Flashcard (180)
studied byStudied by 24 people
... ago
5.0(1)
flashcards Flashcard (115)
studied byStudied by 12 people
... ago
5.0(1)
flashcards Flashcard (54)
studied byStudied by 69 people
... ago
5.0(1)
flashcards Flashcard (61)
studied byStudied by 15 people
... ago
5.0(1)
flashcards Flashcard (34)
studied byStudied by 5 people
... ago
5.0(1)
flashcards Flashcard (38)
studied byStudied by 15 people
... ago
5.0(1)
flashcards Flashcard (342)
studied byStudied by 25956 people
... ago
4.5(122)
robot