From cd0da16c708e9c80940f4d531b09b67358bda755 Mon Sep 17 00:00:00 2001 From: adityacp Date: Mon, 20 Jun 2016 14:49:37 +0530 Subject: cpp file based script --- yaksh/c_cpp_files/file_data.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 yaksh/c_cpp_files/file_data.c (limited to 'yaksh/c_cpp_files') diff --git a/yaksh/c_cpp_files/file_data.c b/yaksh/c_cpp_files/file_data.c new file mode 100644 index 0000000..1c0ab12 --- /dev/null +++ b/yaksh/c_cpp_files/file_data.c @@ -0,0 +1,25 @@ +#include +#include + +extern int ans(); + +template +void check(T expect,T result) +{ + if (expect == result) + { + printf("\nCorrect:\n Expected %d got %d \n",expect,result); + } + else + { + printf("\nIncorrect:\n Expected %d got %d \n",expect,result); + exit (0); + } +} + +int main(void) +{ + int result; + result = ans(); + check(50, result); +} -- cgit