Question

1) Fix the Function #include <iostream> void print Num() { std::cout << number; }; int main() { int number = 35; printNum (nu

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer 1:
#include<iostream>
// It should receive the parameter
void printNum(int number){
   std::cout<<number;
} //; is not required
int main(){
   int number=35;
   printNum(number);
   return 0;
}

Answer 2:
#include<iostream>
// we should take parameter as reference
void doubleNumber(int &num){num=num*2;};
int main(){
   int num=35;
   doubleNumber(num);
   std::cout<<num;
   return 0;
}

Note : Please comment below if you have concerns. I am here to help you
If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
1) Fix the Function #include <iostream> void print Num() { std::cout << number; }; int main()...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT