Menu
Coddy logo textTech

Arrays of different data types

Lesson 4 of 26 in Coddy's Arrays in C++ course.

Arrays can be used to store any kind of data type.

As an example, we can create an array of strings as

string arr[]={"Apple", "Mango", "Banana"};

We have to mention the name of the data type which we want and then continue declaring it.

challenge icon

Challenge

Input an array of size n from the user of data type boolean. Output the number of true values present in it.

Try it yourself

#include<iostream>
using namespace std;

int main(){

  //Write your code here 

    return 0;
}   

All lessons in Arrays in C++