0% found this document useful (0 votes)
21 views2 pages

Computer Assignment

C is a general-purpose programming language developed in the 1970s, known for its low-level memory access and efficiency. A comparison of programming languages highlights that high-level languages are user-friendly and portable, assembly language is machine-dependent and harder to write, while machine language is binary and non-portable but executes the fastest. The document also explains constants, variables, and keywords in C, providing examples for each category.

Uploaded by

kararpita814
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)
21 views2 pages

Computer Assignment

C is a general-purpose programming language developed in the 1970s, known for its low-level memory access and efficiency. A comparison of programming languages highlights that high-level languages are user-friendly and portable, assembly language is machine-dependent and harder to write, while machine language is binary and non-portable but executes the fastest. The document also explains constants, variables, and keywords in C, providing examples for each category.

Uploaded by

kararpita814
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/ 2

Computer Assignment Solutions - Part 3

1. What is C?

- C is a general-purpose, procedural programming language developed by Dennis Ritchie in the

1970s.

- It is widely used for system programming, developing operating systems, embedded systems, and

more.

- Features:

1. Low-level access to memory.

2. Rich set of built-in functions.

3. Portable and efficient.

4. Basis for many modern programming languages like C++, Java.

2. Write a comparison study between High-level, Assembly, and Machine Language.

- **High-Level Language (HLL):**

- Human-readable and easy to write (e.g., C, Python).

- Portable and machine-independent.

- Requires a compiler or interpreter for execution.

- **Assembly Language:**

- Symbolic representation of machine code (e.g., `MOV A, B`).

- Requires an assembler for translation.

- Machine-dependent and harder to write than HLL.

- **Machine Language:**

- Binary code directly understood by the computer (e.g., `1010 0001`).

- Non-portable and extremely difficult for humans to write.


- Fastest execution as it requires no translation.

3. What is Constants, Variables, and Keywords in C? Give examples.

- **Constants:** Fixed values that do not change during program execution.

Example:

```c

#define PI 3.14

const int MAX = 100;

```

- **Variables:** Named memory locations to store data that can change during execution.

Example:

```c

int age = 25;

float salary = 50000.50;

```

- **Keywords:** Reserved words with special meaning in C.

Examples: `int`, `return`, `if`, `while`.

Example Code:

```c

if (x > 0) {

return 1;

```

You might also like