Search
 
SCRIPT & CODE EXAMPLE
 

CPP

array and for loop in c++

//inserting array elements in cpp
#include<iostream>
using namespace std;
int main()
{
  int arr[100];//you can give any data type and any array size you want
  for(int i=0;i<100;i++)
  {
    cin>>arr[i];
  }
  return 0;
}
Comment

C++ Arrays and Loops

string cars[4] = {"Volvo", "BMW", "Ford", "Mazda"};
for (int i = 0; i < 4; i++) {
  cout << cars[i] << "
";
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: balanced parentheses 
Cpp :: c++ set intersection 
Cpp :: string concatenation operator overloading c++ 
Cpp :: c++ formatting 
Cpp :: bubble sort c++ 
Cpp :: print elements of linked list 
Cpp :: recursive factorial of a number 
Cpp :: lists occurrences of characters in the string c++ 
Cpp :: c++ string find last number 
Cpp :: balanced brackets in c++ 
Cpp :: tabeau pseudo dynamique sur c++ 
Cpp :: casting to a double in c++ 
Cpp :: int to string C++ Using stringstream class 
Cpp :: educative 
Cpp :: c++ program to find gcd of 3 numbers 
Cpp :: c++ function pointer as variable 
Cpp :: Valid Parentheses leetcode in c++ 
Cpp :: A Program to check if strings are rotations of each other or not 
Cpp :: initialisation of a c++ variable 
Cpp :: deque 
Cpp :: how to compile c++ code with g+ 
Cpp :: array bubble sort c++ static 
Cpp :: c++ Closest Pair of Points | O(nlogn) Implementation 
Cpp :: OpenCV" is considered to be NOT FOUND 
Cpp :: finding nth most rare element code in c++ 
Cpp :: reverse the number codechef solution in c++ 
Cpp :: increment integer 
Cpp :: is obje file binary?? 
Cpp :: . Single-line comments start with two forward slashes (//). 
Cpp :: c++ vector allocator example 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =