- Print first n natural numbers
- Print first n odd/even numbers
- Calculate n!
- Calculate the nth fibonacci number
- The idea of t testcases for a cp problem
- Take input till sum exceeds 100, then return how many inputs have been taken
- Find min, max and average of n input numbers
- Find all fibonacci numbers upto n
- For n inputs between 1 and 30, find frequency of each number
Re-implement the previous questions using functions
- Find the second and third maximum element in an array of positive integers
- Calculate n! using recursion
- Calculate the nth fibonacci number using recursion
- Draw an n sided pyramid using '*'s
- Write a program that reverses an input string
Only overview, and 1 pass by reference function
C/C++ code is compiled using GCC in Linux(GNU) and MinGW in Windows
gcc is used to compile C and g++ to compile C++
Basic gcc commands
$ g++ [name of file] -o [name of output file]
note: -o [output name of file] is not neccessary. By default it compiles to a file named a.out
.
To run the compiled file, simply do
$ ./a.out
or, for file name,
$ ./[name of output file]