Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
i have written a program for average of two numbers but it's not working?
0
votes
asked
Sep 24, 2018
by
Hamza ishaq
(
120
points)
https://www.onlinegdb.com/edit/BJj9kDBK7
. here is the link
urgent
Please
log in
or register to answer this question.
2 Answers
0
votes
answered
Sep 24, 2018
by
Bubba Whale
(
250
points)
Copy and paste the "Share" link.
Please
log in
or register to add a comment.
0
votes
answered
Sep 28, 2018
by
LeoSar
#include <iostream>
template<class T, class V>
double average2Nums (T a, V b){
return double((a + b)/2);
}
int main()
{
double ans = average2Nums<int, int>(1,2);
std::cout << ans;
return 0;
}
Please
log in
or register to add a comment.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...