Search
 
SCRIPT & CODE EXAMPLE
 

CPP

even number program in c++ using for loop stack overflow

   int func(int x, int y){
      if(y>x && x>0){
        int res = x;
        for(int i = x+1 ; i <= y ; i+=1){
          if(i%2==0)
            res += i;
          else
            res *= i;
        }
        return res;
      }
      return -1;
    }
Comment

PREVIOUS NEXT
Code Example
Cpp :: COs trigonometric function 
Cpp :: solve problem of getline 
Cpp :: simple program for sign in and sign up in c++ 
Cpp :: C++ Initializing a thread with a class/object 
Cpp :: c++ online 
Cpp :: finding nth most rare element code in c++ 
Cpp :: c create 1 bit value 
Cpp :: c++ fstream read line write ,creat file program 
Cpp :: c++ take n number from the user and store them in array and get the max, min number of them and also find the average/summation of these numbers 
Cpp :: glUniform bool 
Cpp :: C++ float and double simple example 
Cpp :: c++ localtime unsafe 
Cpp :: check .h files syntax c++ 
Cpp :: beecrowd problem 1001 solution in c++ 
Cpp :: youtube to facebook link converter 
Cpp :: digits in c++ 
Cpp :: stl map 
Cpp :: Qt asynchronous HTTP request 
Cpp :: Write a CPP program to calculate sum of first N natural numbers 
Cpp :: c++ correct upto 3 decimal places 
Cpp :: sort vector in c 
Cpp :: Runtime error(Exit status:153(File size limit exceeded)) c++ 
Cpp :: C++ Creating a Class Template Object 
Cpp :: inorder to postorder converter online 
Cpp :: ordine crescente "senza" vettori in c++ 
Cpp :: c++ set value to inf 
Cpp :: cpp reference array 
Cpp :: type defination in C++ 
Cpp :: is plaindrome 
Cpp :: cpp full form 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =