Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++

#include <iostream>
using namespace std;
int main() {
 
 // initialize an array without specifying size
 int numbers[] = {7, 5, 6, 12, 35, 27};
 cout << "The even numbers are: ";
 // print array elements
 // use of range-based for loop
 for (auto i : numbers) {
 if(numbers[i] % 2 == 0)
 {
 cout << numbers[i] << ", " << endl;
 }
 }
 
Source by iqcode.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
3+1 =