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

C++ Arrays Functions Notes

The document provides notes on C++ arrays and functions, explaining that an array stores multiple values of the same type and introduces key terms like index and size. It describes how to print array elements using a for loop and defines functions as reusable code blocks, including examples of simple functions, functions with parameters, and functions with return values. Additionally, it offers exam tips emphasizing the importance of understanding for loops, indexing, and function syntax.

Uploaded by

491531anna
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)
9 views2 pages

C++ Arrays Functions Notes

The document provides notes on C++ arrays and functions, explaining that an array stores multiple values of the same type and introduces key terms like index and size. It describes how to print array elements using a for loop and defines functions as reusable code blocks, including examples of simple functions, functions with parameters, and functions with return values. Additionally, it offers exam tips emphasizing the importance of understanding for loops, indexing, and function syntax.

Uploaded by

491531anna
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

C++ Arrays & Functions – FSC Level Notes

1. Array Kya Hota Hai?


Array ek hi type ke multiple values store karta hai.
Example:
int marks[5] = {10,20,30,40,50};

Important Terms
• Index: position (0 se start hoti hai)
• Size: total elements
• Access: marks[0]

Array Print Karna (For Loop)


for(int i=0; i<5; i++)
{
cout << marks[i];
}

2. Function Kya Hota Hai?


Function reusable block hota hai jo specific task karta hai.

Simple Function
void greet()
{
cout << "Hello";
}

Function Call
greet();

Function with Parameters


void sum(int a, int b)
{
cout << a + b;
}
sum(2,3);

Function with Return Value


int sum(int a, int b)
{
return a + b;
}

Exam Tips
• For loop zaroor seekhein
• Index hamesha 0 se start hoti hai
• Function = code reuse
• Syntax yaad rakhein

You might also like