Its my great privilege that you reply me. Sir i would like to share you something, Which will show you why i ask you my previous question.
i write following program in VPL.
Q. Write a program to input 3 number from the keyboard and check which number is greatest.
#include<stdio.h>
int main()
{
int a,b,c;
printf(“enter the avlaue of a,b,c);
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{
if(a>c)
{
printf("a is great");
}
else
{
printf("c is great");
}
}
else
{
if(b>c)
{
printf("b is great");
}
else
{
printf("c is great");
}
}
}
When i run this program
enter the a value of a,b,c 3
2
1
output = a is great
Evaluate
But problem is that when i comapre with test case
case1 :
case = check gretest number
input 3
2
1
output=a is great
-------+
| 1 test run/ 0 test passed |
+------------------------------+
Test case failed 0/100
case2 :
case = check gretest number
input 3
2
1
output=b is great
-------+
| 1 test run/ 1 test passed |
My view
To evaluate a program I passed two different test cases. According to me case 1 is correct because its output match with program output. But the moodle gives a result test case failed.
Similarly I passed a second case, which according to me is wrong because it does not match with program output.
Thats why i ask that one question. Why its behave strange.