summaryrefslogtreecommitdiff
path: root/yaksh/c_cpp_files
diff options
context:
space:
mode:
authorKing2016-07-28 17:39:44 +0530
committerGitHub2016-07-28 17:39:44 +0530
commit2b03aeb36fa333ea1644a248c742cf0c1df12a5f (patch)
tree4c753ba9a1fbccf3e06d1ed1d998137c88a73b88 /yaksh/c_cpp_files
parent344e1e804cee214c0d0f5c41ca16d871e786d4c3 (diff)
parent83bee9d89e163e98504c8aa210ce60200bd1cd1d (diff)
downloadonline_test-2b03aeb36fa333ea1644a248c742cf0c1df12a5f.tar.gz
online_test-2b03aeb36fa333ea1644a248c742cf0c1df12a5f.tar.bz2
online_test-2b03aeb36fa333ea1644a248c742cf0c1df12a5f.zip
Merge pull request #113 from adityacp/file_based_questions
File based questions
Diffstat (limited to 'yaksh/c_cpp_files')
-rw-r--r--yaksh/c_cpp_files/file_data.c25
1 files changed, 25 insertions, 0 deletions
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 <stdio.h>
+#include <stdlib.h>
+
+extern int ans();
+
+template <class T>
+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);
+}