General discussion

Locked

C Source code help

By Vicpri ·
Hello, while doing the below c program, i am not getting the output....can u please help me to get the output by changing the source code, it's urgent plsz help me......
.
..
...
http://pastebin.com/m5f39b3de
.
..
...
or
.
..
...
/*Functions using fprintf and fscanf*/
#include
#include
main()
{
FILE *fp;
int sno,b,aa,bs,t;
char sname[20],ch;
float avg;
clrscr();
fp=fopen("Bcom.txt","a");
if(!fp)
{
printf("File Opening Error");
exit();
}
else
{
printf("File is Openend");
printf("\nEnter Student Details");
do
{
printf("\nEnter Student no\t");
scanf("%d",&sno);
printf("\nEnter Student Name\t");
scanf("%s",&sname);
printf("\nEnter 3 Subject Marks\t");
scanf("%d%d%d",&b,&aa,&bs);
t=b+aa+bs;
avg=t/3;
fprintf(fp,"\n\t%d\n%s\n%d\n%d\n%d\n%d%d%f");
printf("Do u want to add any record (y/n)");
fflush(stdin);
ch=getch();
}
while(ch=='y')
rewind(fp);
}
while(!eof(fp))
{
printf("%d%s%d%d%d%d%f",sno,sname,b,aa,bs,t,avg);
}
fclose(fp);

(Error:

rewind(fp);

for the above line it is showing "do-while statement missing ; in function main" )

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Comments

Back to Malware Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums