powers of 2 in cpp
C++
// C program to illustrate
// power function
#include <math.h>
#include <stdio.h>
int main()
{
double x = 6.1, y = 4.8;
// Storing the answer in result.
double result = pow(x, y);
printf("%.2lf", result);
return 0;
}
// If not using any extra libraries
// Powers of 2. If finding 2^n
int main() {
int ans = 1 >> n;
}
// Suppose we want to find x ^ y
void power(int x, int y) {
int ans = 1;
for (int i = 0; i < y; i++) {
ans *= x;
}
return ans;
}
Also in C++:
- Title
- recursion in cpp with reference
- Category
- C++
- Title
- binary search stl in c++
- Category
- C++
- Title
- how to decalre a string in c++
- Category
- C++
- Title
- how to convert string into number
- Category
- C++
- Title
- rand c++
- Category
- C++
- Title
- c++ declare char
- Category
- C++
- Title
- never gonna give you up lyrics
- Category
- C++
- Title
- insert function in c++ vector
- Category
- C++
- Title
- min coin change problem dp
- Category
- C++
- Title
- file objects in c++
- Category
- C++
- Title
- c++ unittest in ros
- Category
- C++
- Title
- opencv compile c++
- Category
- C++
- Title
- cout value c++
- Category
- C++
- Title
- delete a double pointer c++
- Category
- C++
- Title
- % operator in c++
- Category
- C++
- Title
- max in c++
- Category
- C++
- Title
- mkdir boost filesystem
- Category
- C++
- Title
- c++ isalphanum
- Category
- C++
- Title
- building native binary with il2cpp unity
- Category
- C++
- Title
- Runtime Error: Runtime ErrorAbort signal from abort(3) (SIGABRT)
- Category
- C++
- Title
- how to initialize a vector in c++
- Category
- C++
- Title
- subarray sum in c++
- Category
- C++
- Title
- c++ class inheritance
- Category
- C++
- Title
- UPARAM(ref)
- Category
- C++
- Title
- passing a vector to a function c++
- Category
- C++
- Title
- transpose matrix eigen c++
- Category
- C++
- Title
- Given an undirected graph, count the number of connected components.
- Category
- C++
- Title
- c++ how to add something at the start of a vector
- Category
- C++
- Title
- remove item from layout
- Category
- C++
- Title
- Convert binary tree to a doubly linked list
- Category
- C++
- Title
- floor() in c++
- Category
- C++
- Title
- declare vectors c++
- Category
- C++
- Title
- c++ sql
- Category
- C++
- Title
- std::substring
- Category
- C++
- Title
- c++ looping through a vector
- Category
- C++
- Title
- how to include seld declared header file in c++
- Category
- C++
- Title
- c++ triple
- Category
- C++
- Title
- convert int to string c++
- Category
- C++
- Title
- vector concat c++
- Category
- C++
- Title
- c++ read file line by line
- Category
- C++
- Title
- c++ formatting
- Category
- C++
- Title
- cut by delimiter c++
- Category
- C++
- Title
- multiset c++
- Category
- C++
- Title
- c++ give options
- Category
- C++
- Title
- c++ pointers
- Category
- C++
- Title
- log base e synthax c++
- Category
- C++
- Title
- stringstream in c++ with delimiter
- Category
- C++
- Title
- pairs in c++
- Category
- C++
- Title
- initialize vector of pointers c++
- Category
- C++
- Title
- c++ sort
- Category
- C++
- Title
- c++ create array
- Category
- C++
- Title
- c++ scanf
- Category
- C++
- Title
- exponenciacion binaria
- Category
- C++
- Title
- C++ remove element from set
- Category
- C++
- Title
- inserting an element in an set c++
- Category
- C++
- Title
- sqrt in c++
- Category
- C++
- Title
- c++ how to return an empty vector
- Category
- C++
- Title
- c++ switch
- Category
- C++
- Title
- time conversion hackerrank solution in c++
- Category
- C++
- Title
- command line options in c++
- Category
- C++
- Title
- new in c++
- Category
- C++
- Title
- find_if c++
- Category
- C++
- Title
- count a character in a string c++
- Category
- C++
- Title
- error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(s[i] != "b"){
- Category
- C++
- Title
- centos7 mlock2
- Category
- C++
- Title
- minimum swaps to sort an array
- Category
- C++
- Title
- how to compile opencv c++ in ubuntu
- Category
- C++
- Title
- c++ convert int to double
- Category
- C++
- Title
- solve linear equations geeksforgeeks
- Category
- C++
- Title
- converting char to int in c++
- Category
- C++
- Title
- how to declare a function in c++
- Category
- C++
- Title
- vertical traversal of binary tree
- Category
- C++
- Title
- how print fload wiht 3 decimal in c++
- Category
- C++
- Title
- system("pause") note working c++
- Category
- C++
- Title
- double to int c++
- Category
- C++
- Title
- how use global variables instead of local in c++
- Category
- C++
- Title
- memcmp in cpp
- Category
- C++
- Title
- vector initialization c++
- Category
- C++
- Title
- popualte an array c++
- Category
- C++
- Title
- c++ typedef
- Category
- C++
- Title
- lisy stl C++
- Category
- C++
- Title
- cube mapping sdl
- Category
- C++
- Title
- preorder traversal c++
- Category
- C++
- Title
- iostream library in cpp
- Category
- C++
- Title
- fast input output in c++
- Category
- C++
- Title
- c++ variable argument
- Category
- C++
- Title
- how to sort an array c++
- Category
- C++
- Title
- hobo 8
- Category
- C++
- Title
- split 2d array into chunks in c++
- Category
- C++
- Title
- c++ while true
- Category
- C++
- Title
- create a 2d array c++
- Category
- C++
- Title
- initialize array c++
- Category
- C++
- Title
- c++ program for matrix addition
- Category
- C++
- Title
- string substr c++
- Category
- C++
- Title
- do while loop c++
- Category
- C++
- Title
- how to get a letter from the users string in c++
- Category
- C++
- Title
- how can make string value in cpp
- Category
- C++
- Title
- c++ do you not inherit constructor
- Category
- C++
- Title
- while loops
- Category
- C++
- Title
- c++ read matttrix from text file
- Category
- C++