1. There are how many ways for delimiting an un-indexed sequence of objects?
Answers
1. 1
2. 2
✅
3. 3
4. 4
2. What is correct output of given code snippets?
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
fstream fs;
char data[16];
fs.open("abc.txt")
fs << "hello world" << endl;
getline(fs, data);
fs.close();
cout << data << endl;
return 0;
}
Answers
1. hello world
2. syntax error
✅
3. no output
4. runtime error
3. What is correct output of given code snippets?
#include <iostream>
using namespace std;
int main()
{
int i = 0;
do {
cout << i << " ";
i++;
} while(i < 4);
}
Answers
1. 1 2 3
2. 0 1
3. 0 1 2
4. 0 1 2 3
✅
4. Which from the following format flag is not included in ios: : adjustfield mask?
Answers