Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
How to read the input data into functions?
I'm having a lot of troubles trying to read the input data into the program. I'm a beginner of C++ and this is my first time to learn to use functions. I wrote out the code but I only got zero. Can someone please help me out?
I have use the following input data:
to determine the integers if they are:
1)a multiple of 7, 11 or 13
2)sum of the digits odd or even
3)the square root value(if positive)
4)is it a prime number
and here is my code:#include#include#include#include
using namespace std;#define
if (num%7==0 || num%11==0 || num%13==0)
cout<<num<<" is a multiple of 7, 11 or 13."<<endl;
cout<<num<<" is a even number."<<endl;
cout<<num<<" is a odd number."<<endl;
double square(double value)
cout<<"The square root value is: "<<value<<endl;
for (int i=2; i<=num; i++)
for (int j=2; j<i; j++)
cout<<num<<" is a prime number."<<endl;
cout<<num<<" is not a prime number."<<endl;
0 · ·