स्ट्रिंग कीवर्ड का उपयोग करके C++ में स्ट्रिंग्स की सरणी बनाई जा सकती है। यहां हम इस दृष्टिकोण का उपयोग करके C++ प्रोग्राम पर चर्चा कर रहे हैं।
एल्गोरिदम
Begin Initialize the elements of array by string keyword. And take string as input. Print the array. End.
उदाहरण कोड
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main() {
string Fruit[3] = {"Grape", "Mango", "Orange"};
cout <<"The name of fruits are:"<< "\n";
for (int i = 0; i < 3; i++)
cout<< Fruit[i]<<",";
return 0;
} आउटपुट
The name of fruits are: Grape, Mango, Orange