Search
 
SCRIPT & CODE EXAMPLE
 

CPP

sum of 2 arrays c++

#include <iostream>

int main(){
  	float sum=0;
    int array [3][5] = 
    {
        { 1, 2, 3, 4, 5, }, // row 0
        { 6, 7, 8, 9, 10, }, // row 1
        { 11, 12, 13, 14, 15 } // row 2
    };
  
  for ( i = 0; i < 3; i++ ){
  	for ( j = 0; j < 5; j++ ){
      sum+=array[i][j];
  	}
  }
  std::cout << sum << std::endl;
  
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: three-way comparison c++ 
Cpp :: c++ sort a 2d vector by column 
Cpp :: prime template c++ 
Cpp :: inversed priority queue 
Cpp :: c++ compile to msi 
Cpp :: round function in c++ 
Cpp :: jquery ajax post json asp.net core 
Cpp :: operator = overloading c++ 
Cpp :: c++ get last element in array 
Cpp :: iterator c++ 
Cpp :: what does : mean in c++ 
Cpp :: constants in cpp 
Cpp :: c++ permutation 
Cpp :: constructor overloading in c++ 
Cpp :: uses of c++ 
Cpp :: cpp hello world 
Cpp :: create a bitset of 1024 bits, 
C :: c bold text 
C :: How to install npm in alpine linux 
C :: how to use gets after scanf 
C :: scanf ignore new line 
C :: data types in c 
C :: Prime Number Check Program in C 
C :: write a program in c to check whether the number is armstrong or not 
C :: c bit access union 
C :: armstrong number in c 
C :: c read csv 
C :: how to scanf two dimensional array in c 
C :: c convert char to int 
C :: plt legend top right outside 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =