#include <iostream>
using namespace std;
int main() {
int n, i;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i == 6 || i == 9)
continue;
cout << i << " ";
}
return 0;
}
Question- write 1 to n integer numbers but she do not write 6 and 9. you required to write a cpp program using "if" and "for" loop concepts and help to sakshi. Input Method: Get "n" which is the input number. Output Method: Print the integer value without 6 and 9.
TEST CASE 1:
INPUT
11
OUTPUT
1 2 3 4 5 7 8 10 11
My output:
1 2 3 4 5 7 8 10 11
I am getting one extra space after this 11 how to stop that? This program is printing one extra space in the output