test cases

what is test cases?can u give an example program with question and solution how to give inputs outputs


Suppose you want to test whether a number is odd or even.
Where T is the test cases. and first line of each test case contains a integer which will be tested.
And finally print whether each input is even or odd ?

Test Case :

So basically test cases means the number of times you will take input to execute your code and to produce the desired output.

Test Case=5;


int T=5,i,input;
printf("\nGive a input:");
printf("\n%d is Even",input);
printf("\n%d is Odd",input);
} //Loop End for test cases

So Here your code will run five times to take five inputs to check whether that is odd or even.

That’s all.

Let me inform if you have any other doubts.