0% found this document useful (0 votes)
40 views3 pages

Basic C Notes

C is a general-purpose procedural programming language developed in the early 1970s. Key concepts include basic syntax, variables and data types, input/output functions, control structures, functions, arrays, pointers, structures, and comments. Examples are provided for each concept to illustrate their usage.

Uploaded by

boniganesh812
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)
40 views3 pages

Basic C Notes

C is a general-purpose procedural programming language developed in the early 1970s. Key concepts include basic syntax, variables and data types, input/output functions, control structures, functions, arrays, pointers, structures, and comments. Examples are provided for each concept to illustrate their usage.

Uploaded by

boniganesh812
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

Basic C Notes

1. Introduction

- C is a general-purpose procedural programming language.

- Developed in the early 1970s by Dennis Ritchie.

2. Basic Syntax

- Every C program has a main() function.

- Statements end with a semicolon (;).

- Example:

#include <stdio.h>

int main() {

printf("Hello, World!\n");

return 0;

3. Variables and Data Types

- int, float, double, char, void

- Example:

int age = 30;

float pi = 3.14;

4. Input and Output

- Use scanf for input, printf for output.

- Example:
int number;

scanf("%d", &number);

printf("Number is %d\n", number);

5. Control Structures

- if, else if, else

- switch

- loops: for, while, do-while

6. Functions

- Declared with return type, name, and parameters.

- Example:

int add(int a, int b) {

return a + b;

7. Arrays

- Fixed size collection of elements.

- Example:

int arr[5] = {1, 2, 3, 4, 5};

8. Pointers

- Store memory addresses.

- Example:

int* ptr = &age;


9. Structures

- Group variables under one name.

- Example:

struct Point {

int x;

int y;

};

10. Comments

- Single line: //

- Multi-line: /* */

You might also like