Answer:
endl
Explanation:
Note that endl must be free of quotation marks; otherwise, the program will treat it as a string.. The \n Character. The other way to break a line in C++ is to use the newline character
You may do all of the given options.
Thank You!
Answer:
True
Explanation:
a lot of people use this as a way to keep things nice and safe, but sometimes thinks don’t go as planned. Don’t really know how else to answer this lol
Answer:
Code is given below and output is attached as an image.
Explanation:
#include <iostream>
#include <fstream>
using namespace std;
bool isPalindrome(int n)
{
// Find reverse of n
int rev = 0;
for (int i = n; i > 0; i /= 10)
rev = rev * 10 + i % 10;
// If n and rev are same,then n is a palindrome
return (n == rev);
}
int main()
{
int min = 1; // Lower Bound
int max = 200; // Upper Bound
ofstream myfile;
myfile.open("palindrome.txt");
for (int i = min + 1; i < max; i++)
if (isPalindrome(i))
myfile << i << endl;
myfile.close();
return 0;
}