-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1d_usingfun.c
More file actions
129 lines (124 loc) · 3.15 KB
/
Copy path1d_usingfun.c
File metadata and controls
129 lines (124 loc) · 3.15 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#include <stdio.h>
int c = 0;
int inputanswers(int a[])
{
for (int i = 0; i < 6; i++)
{
scanf("%d", &a[i]);
}
}
int grades(int cor[], int std[])
{
for (int i = 0; i < 6; i++)
{
if (cor[i] == std[i])
{
c++;
}
}
if (c >= 3)
{
return 1;
}
else
return 0;
}
int index_of_correct(int cor[], int std[])
{
int incorrect;
printf("Incorrect:\n");
for (int i = 0; i < 6; i++)
{
if (cor[i] != std[i])
{
incorrect = i + 1;
printf("%d", incorrect);
}
}
}
int concer_index_option(int a[], int b)
{
for (int i = 0; i < 6; i++)
{
int f = 0;
if (b == i)
{
printf("Option against index is %d\n", a[i]);
}
}
}
int Sequence(int a[],int b[],int c)
{
for(int i=0;i<c;i++)
{
for(int j=i+1;j<c;j++)
{
}
}
}
// int occurance(int a[],int b[],int *b,int *c,int *d,int*e)
// {
// // int c0,c1,c2,c3;
// for(int i=0;i<6;i++)
// {
// if(b[0]==a[i])
// {
// b++;
// }
// if(b[1]==a[i])
// {
// c++;
// }
// if(b[2]==a[i])
// {
// d++;
// }
// if(b[3]==a[i])
// {
// e++;
// }
// }
// }
int main()
{
int n = 6;
int correct_answer[6] = {2, 2, 4, 3, 2, 1};
int student_answer[6];
printf("Enter Your options for 6 mcqs respecitvely\n");
inputanswers(student_answer);
int grade_rtn = grades(correct_answer, student_answer);
if (grade_rtn == 1)
{
Sequence(correct_answer,student_answer,c);
printf("You are passed\n");
if (c == 6)
{
printf("Excellent\n");
}
}
else
{
printf("You are fail\n");
if (c == 0)
printf("Poor performance\n");
}
index_of_correct(correct_answer, student_answer);
/*DisplayTheSpecificAnswerFromCorrectAnswersofQuestionsArrayUsingPassedIndex: User will pass the
index number. And then using that index value display the correct answer/option from
CorrectAnswersofQuestions Array. CorrectAnswersofQuestionsmust be passed. */
int correct_index;
printf("Enter your index\n");
scanf("%d", &correct_index);
concer_index_option(correct_answer, correct_index);
/*CountTheOccuranceOfAllOptions_1_2_3_4_inTheCorrectAnswersofQuestionsArray: In this function
separately count the Occurrence Of All the Options (1,2,3,4) in CorrectAnswersofQuestions array.
and all count values should be printed in the main function. Use CorrectAnswersofQuestions array in this
function.*/
// int occurance_array[4]={1,2,3,4};
// int c0,c1,c2,c3=0;
// occurance(correct_answer,occurance_array,&c0,&c1,&c2,&c3);
// printf("%d %d %d %d",c0,c1,c2,c3);
/*CheckAnswersofQuestionsArray: In this function, Check that whether question numbers of all correct
answers given by the student are in consecutive order or not. return 1 in case Yes and return 0 in case No.
Use StudentAnswersofQuestions and Use StudentAnswersofQuestions arrays. */
}