
What will be the output of the following C++ code?#include <iostream>#include <string>#include <algorithm>using namespace std;int main(){string s = "spaces in text";s.erase(remove(s.begin(), s.end(), ' ' ), s.end() ) ;cout << s << endl;}a) spacesintextb) spaces in textc) spacesd) spaces inAnswer: a
#include <stdio.h>
void m(int k)
{
printf("hi");
}
void m(double k)
{
printf("hello");
}
void main()
{
m(3);
}
#include<stdio.h>int c[10] = {1,2,3,4,5,6,7,8,9,10};main(){int a, b=0;for(a=0;a<10;++a)if(c[a]%2 == 1)b+=c[a];printf("%d", b);}