-
Notifications
You must be signed in to change notification settings - Fork 0
/
main (1).c
69 lines (54 loc) · 1.38 KB
/
main (1).c
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
#include <stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
struct student {
char firstName[5000];
int roll;
float marks;
} s[50];
int
main()
{
int choice;
int i, j, n, keepcount;
i = j = keepcount = 0;
while (j !=6)
{
printf("\n###### Welcome to SRM Student's Mark list 2022 ######\nChoose The options bellow\n");
printf("1. storing Student's Information :\n");
printf("2. Displaying Student's Information :\n");
printf("3. Exit\n");
scanf ("%d", &j);
switch (j)
{
case 1:
// storing information
printf("~~~~Please Enter Names/Marks Roll number wise~~~~");
printf("\nEnter first name: ");
scanf("%s", s[i].firstName);
printf("Enter Marks: ");
scanf("%f", &s[i].marks);
keepcount++;
printf ("\n ----- Marks of %d students added succefully -----\n\n\n",keepcount);
break;
case 2:
printf("Displaying Information:\n\n");
// displaying information
for (i = 0; i < keepcount; ++i)
{
printf("\nRoll number: %d\n", i + 1);
printf("First name: ");
puts(s[i].firstName);
printf("Marks: %.1f", s[i].marks);
printf("\n");
}
}
if (j!=1&&j!=2){
printf("!!! YOUR ARE OUT OF POGRAM!!!\n\t***TRY AGAIN ***");
exit (0);
}
}
//break;
return 0;
}