Skip to content

Commit d3cea61

Browse files
authored
Add files via upload
1 parent 19bd5b4 commit d3cea61

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

Score.txt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Name Score
2+
------- -------
3+
lol 50
4+
5+
41 6
6+
7+
hasan 50
8+
9+
rishan 50
10+
11+
rabby 50
12+
13+
rishan 66
14+
15+
rabby 10

Untitled1.c

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include<stdio.h>
2+
int main()
3+
{
4+
FILE *file;
5+
char name[25];
6+
int score;
7+
file=fopen("score.txt","a");
8+
if(file==NULL)
9+
{
10+
printf("File does not exist");
11+
}
12+
else
13+
{
14+
printf("File is opened\n");
15+
16+
17+
18+
19+
{
20+
printf("Enter Gamer Name : ");
21+
scanf("%s",&name);
22+
printf("Enter Gamer score : ");
23+
scanf("%d",&score);
24+
25+
fprintf(file,"\n%s\t\t%d\t\n",name,score);
26+
27+
}
28+
printf("File is written successfully\n");
29+
30+
fclose(file);
31+
}
32+
getch();
33+
}

Untitled1.exe

29.4 KB
Binary file not shown.

Untitled1.o

1.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)