Hello!
I have to write a program writting a line made of * if the input number is odd and 0 if the number is even. Have to use functions with stings. I could nt find the example.
#include<iostream>
#include<string>
using namespace std;
int main() {
int a;
cout<<"Input number smaller than 10 ";
cin>>a;
void line1(){
for (int i=1, i<=a; i++){
cout<<"*";
}}
void line2() {
for (int b=1, b<=a; b++){
cout<<"=";
}}
if (a%2==0)
cout<<line1;
else
cout<<line2
return 0;
}