help pizzzz.i have an unusual result
when input any vaule for mark i have a symbol of an 'e' as the result..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#include <iostream>
#include <stdlib.h>
using namespace std;
double getmark();
char computeGrade(double mark);
int main()
{
char grade;
double mark;
getmark();
grade = computeGrade(mark);
}
double getmark(){
double mark;
cout<<"enter mark";
cin>>mark;
return mark;
}
char computeGrade(double mark)
{
char grade;
if ((mark>85) && (mark<100))
grade ='A';
else if((mark>75) && (mark<84))
cout<<'B';
else if ((mark>65) && (mark<74))
cout<<'C';
else
{
}
return grade;
}
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#include <iostream>
#include <stdlib.h>
using namespace std;
double getmark();
char computeGrade(double mark);
int main()
{
char grade;
double mark;
mark = getmark();
grade = computeGrade(mark);
std::cout << grade;
}
double getmark(){
double mark;
cout<<"enter mark";
cin>>mark;
return mark;
}
char computeGrade(double mark)
{
char grade;
if ((mark>=85) && (mark<=100))
grade = 'A';
else if((mark>=75) && (mark<=84))
grade = 'B';
else if ((mark>=65) && (mark<=74))
grade = 'C';
else
{
}
return grade;
}
|
Topic archived. No new replies allowed.