Don’t worry, unlock all articles / blogs on PrepInsta by just simply logging in on our website
Type atleast 3 characters
Popular Searches
Trending Pages
Notifications Mark All Read
No New notification
Hexaware Menu9>
PREPINSTA PRIME
Get Hiring Updates right in your inbox from PrepInsta
Question 1
#include<iostream> using namespace std; int main() { arr[5] = {2, 6, 7, 9, 10}; return 0; }
2
3
1
4
Start
Question 2
#include<iostream> using namespace std; int main(){ int arr[6]= {2,4,6,8,10,12}; for(int i=0;i<6;i+=3){ cout<<arr[i]<<" "; } return 0; }
2 6 10
4 8 12
2 8
2 10
Question 3
#include<iostream> using namespace std; int main(){ int n, sum =0; int i=0; while(i<=n){ sum = i+n; i+=2; } cout<<sum; return 0; }
5,8,10
5,7,9
6,8,10
5,7,8
Question 4
#include<iostream> using namespace std; int main(){ string str = "Prepinsta"; string s; for(int i=0;i<str.length(); i+=2){ s += str[i]; } s.pop_back(); cout<<s; return 0; }
Peis
Peisa
eisa
Pisa
Question 5
#include<iostream> using namespace std; int main(){ string str = "*"; string s; for(int i=0;i<10; i+=3){ s += str[0]; if(i%2!=0) s+= "#"; } cout<<s; return 0; }
**#**#
#**#**
***#***#
#***#*
Question 6
320
10
20
340
Question 7
7 8 11 8 9
7 8 11 5 6
1 3 4 5 6
8 5 3 2 10
Question 8
#include<iostream> using namespace std; int main(){ string s = "prepinsta"; int i=0; for(int j=s.length()-1; j>=0; j--){ cout<<s[i]; i++; } return 0; }
Reverse the string
Don’t change the string
Remove the characters from string
Print half characters from string
Question 9
peni
ppnta
pepsa
peita
Question 10
#include<iostream> using namespace std; int main(){ string str = "prepinsta"; int i=0, j=str.length()-1; while(i<=j){ swap(str[i],str[j]); i++; j--; } return 0; }
Swap the last character
Delete the middle character
Please login to report