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

C Programming Notes

The document provides an overview of C programming, covering basics such as algorithms, program structure, input/output, control structures, arrays, structures, functions, and pointers. It includes examples for each topic, demonstrating how to implement algorithms, control flow, data structures, and user-defined functions. The content is organized into units that progressively build on fundamental programming concepts.

Uploaded by

Arpita Siddhanti
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)
2 views2 pages

C Programming Notes

The document provides an overview of C programming, covering basics such as algorithms, program structure, input/output, control structures, arrays, structures, functions, and pointers. It includes examples for each topic, demonstrating how to implement algorithms, control flow, data structures, and user-defined functions. The content is organized into units that progressively build on fundamental programming concepts.

Uploaded by

Arpita Siddhanti
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

Programming in C - Easy Notes

Unit 1: Basics of C Programming

Algorithm: Step-by-step solution to a problem.


Example: Add two numbers
1. Start
2. Input A, B
3. Sum = A + B
4. Print Sum
5. Stop

Structure of C Program:
#include<stdio.h>
int main()
{
int a = 5;
printf("Hello");
return 0;
}

Input/Output:
int a;
scanf("%d",&a);
printf("%d",a);

Unit 2: Control Structures

If-Else Example:
if(a%2==0)
printf("Even");
else
printf("Odd");

For Loop:
for(int i=1;i<=5;i++)
{
printf("%d",i);
}

Unit 3: Arrays & Structures

Array Example:
int a[5]={1,2,3,4,5};

Structure Example:
struct student
{
int roll;
float marks;
};

Unit 4: Functions
User Defined Function:
int add(int a,int b)
{
return a+b;
}

Recursion Example:
int fact(int n)
{
if(n==1) return 1;
return n*fact(n-1);
}

Unit 5: Pointers

Pointer Example:
int a=10;
int *p;
p=&a;

Pointer stores address of variable.

You might also like