C
C
9. (Garbage Values)- These are those types of values which are empty and when it
cout then it would
always give us random values.Either it is positive or
negative.
10. <cin> and <cout> are not functions rather they are global objects.
11. There are 3 types operators at c++- Arithmatic operators, logical operators and
relational operators.
13. At the word Binary, 'Bi' means 2. At the word Unary, 'U' means only 1.
16. (a++) or (a--)-> first performs the operation then update.It is known as post-
increment operator.
(++a) or (--a)-> first update then perform the operation.It is known as pre-
increment operator.
17. <else-if> is used with <if> and <else> if there are multiple conditionals then
it is used.
18. Uppercase character ascii value is 65 to 96 and Lowercase character ascii value
is 97 to 122.
19. ASCII stands for "American Standerd Code of Information Interchange".
20. (Ternary statements)- Here Ternary means 3. Ternary statement is nothing but a
single statement
version of conditionals.It is followed by <?> for the
condition.And different
statement based on a condition are seperated by the
<:>.
eg- int m = 3;
m < 5 ? "pos" : "neg";
*This type of statement is generally used for <if-else>
condition but if <else if>
is also needed then it is not used in action.
22. At c++, there are 3 types of loops- <while>loop, <for>loop and <do-while>loop.
22. camelCase is a type of case of naming of variables where the first word of the
identifier is small case and the second
word of the identifier is at Uppercase where the words are not seperated by
a space.
23. do-while loop performs the operation first then checks the condition.
24. C++ has built-in function for finding factorial of any any number.It is
factorial().
25. At both C or C++, a return value of 0 means success(<return 0;>) and return
value of 1 means failiure(<return 1;>).
26. factorial is denoted by the symbol <!> with that number-> <n!> this is n
factorial.
27. Patterns are those types of special program whcih are made up of loops and
nested loops only.
28. In continuous pattern problems, we take a variable and store the last progress
done by every iteration then start with that value at the next iteration.
29. In c++, you cannot directly compare C-style strings with == for condition
check. Instead you need to use the <strcmp()> the <cstring>library Or just include
the string-
library and use the string data type instead of char data type.
(Properties of arrays)~
1. We can store data only of same type of data type at every block
of an array.
2. Arrays are contiguous in memory.
3. Arrays are lenear(straight line structures).
4. Every block of an array occupies a space of a single integer.
5. If we want to initialize the size of an array to a fixed length
then we can or if we dont then there is no problem(according to the length of the
array, the size would be initialized).
31. (Algorithms)- It is a form of efficient method of performing operation on a
particular set of data. Those diffrent methods are
known as algorithms. It is also a method of searching of data
i.e is only an operation.
32. In c++, positive infinity is written as <INT_MAX> and the negative infinity is
written as <INT_MIN>.
33. There is a built in function for checking that whether a string contains
alphanumeric characters or not.
syntax- <isalnum()>.
35. In c++ for representing the <n> factorial, we represent it as <n!> means to
take the product of all the values from 1 ro n.
36. Based on the context of c++, memory is of two types, stack and heep.
37. When all the operations and execution is performed after returning all the
desired output, all the stack frames are erased hence,
all the memory is cleared and ready for next code.
39. <const>type is used before any data type variable or value to make it
completely constant type means even initialization would not
change the value of that variable even it is <int>, <float> etc. If it
is initialized then compiler would show us an error.
40. A variable identifier with all caps idicates that the variable value is a
constant, a lateral value.
41. For finding whether a number is prime or not, four conditions must be checked~
if n <= 1, then it is not prime number.
if n % 2 or n % 3 != 0, then it is a prime number.
if n % 2 or n % 3 == 0, then it is not a prime number.
if n == 2 or n == 3, then it is a prime number.
*But there are certain numbers which are not divisible by 3 and 2 but then also
they are not prime.
{C++ built-in-functions}~~
1. In c++, we are provided with built function for finding the maximum or minimum
between any number or say values in an array of nums.
For comparing about the maximum value, we use the <max()>. And for minimum
is <min()>.
2. <count()>- For using this function, first the algorithm library must be
included.THis function could be used for counting the number of occurence of a
particular
number in an array.
3. <find()>- This function is used for finding the indicis of any particular
number. For using this we iterate from the begining to end
and then the target is declared. For using this function, first
algorithm library must be included.
(syntax)- int* idx_cont = find(begin(array_nums),
end(array_nums), small_val);
4. <change()>- This funciton could be sued for changing the value of any variable
at its original format. This is widely used at
functions specially at Pass by Reference.
5. <lower()>- This function is used to convert an upper case character into lower
case character.
7. <sqrt()>- For using this function, first the cmath library must be added. This
function
could be used for finding the square root of any number.
{Functions}~
(syntax of a function)-
returntype printhello(){
//operation.
}
here, <returntype> is the type of data which we are returning from a function.
<printhello()> is the name of the function.
1. Functions which does not return anything, the there return type must becout <<
"Greater: " << sum(10, 5) << endl; <void>.
2. A function does not works until and unless we do not call the function. That is
function call or say function invoke.
3. The Inputing of any variable inside of a function is known as parameters.