本文介绍了你好!世界C程序问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

您好frndz,每当我执行我的代码时,我的代码中就有问题,它没有显示所获得的标记结果,这是什么问题..这是代码

hello frndz , i got a problem in my code whenever i excute my code it dont show the obtained marks result whats the problem in it .. here is the code

#include<stdio.h>
#include<conio.h>

void main ()

{


float physics,obt,a,b,d,e,f,g,c,maths,computer,english,urdu,pakstudies;
float total,avg,percentage;
clrscr();
printf("	\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
printf("	\nkindly enter your total marks and obtained marks of each subject");
printf("	\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
printf("	\nEnter total marks of physics:");
scanf("%f",&physics);
printf("	\nEnter obtained marks in physics:");
scanf("\n\t %f",&a);
c=(a/physics)*100;
printf("%.3f",c);
if(c<40)
{printf("\n u R fail in physics:(");
getch();
clrscr();
}
else if(c>=40)
{
printf("\n u R pass in physics:)");
getch();
clrscr();
}
printf("	\nEnter total marks of maths:");
scanf("%f",&maths);
printf("	\nEnter obtained marks of maths:");
scanf("%f",&b);
c=(b/maths)*100;
printf("\n\t %.3f",c);
if(c<40)
{
printf("\nu R fail in maths:(");
getch();
clrscr();
}
else if(c>=40)
{
printf("\n u R pass in maths:)");
getch();
clrscr();
}
printf("	\nEnter total marks of computer:");
scanf("%f",&computer);
printf("	\nEnter obtained marks of computer:");
scanf("\n\t %f",&d);

c=(d/computer)*100;
printf("\n\t %.3f",c);
if(c<40)
{
printf("\n u R fail in computer:( ");
getch();
clrscr();
}
else if(c>=40)
{
printf("\n u R pass in computer:)");
getch();
clrscr();
}


printf("	\nEnter total marks of english:");
scanf("%f",&english);
printf("	\nEnter obtained marks of english:");
scanf("%f",&e);
c=(e/english)*100;
printf("\n\t %.3f",c);
if(c<40)
{
printf("\nu R fail in english:( ");
getch();
clrscr();
}
else if(c>=40)
{
printf("\n u R pass in english:) ");
getch();
clrscr();
}
printf("	\nEnter the marks of urdu:");
scanf("%f",&urdu);
printf("	\nEnter obtained marks of urdu:");
scanf("%f",&f);
c=(f/urdu)*100;
printf("\n\t %.3f",c);
if(c<40)
{
printf("\n u R fail in urdu:( ");
getch();
clrscr();
}
else if(c>=40)
{
printf("u R pass in urdu:) ");
getch();
clrscr();
}

printf("	\nenter the marks of pakstudies:");
scanf("%f",&pakstudies);
printf("	\nEnter obtained marks of pakstudies:");
scanf("%f",&g);
c=(g/pakstudies)*100;
printf("\n\t %.3f",c);
if(c<40)
{
printf("	\nu R fail in pakstudies:( ");
getch();
clrscr();
}
else if(c>=40)
{
printf("	\nu R pass in pakstudies:) ");
getch();
clrscr();
}
total=physics+maths+computer+english+urdu+pakstudies;
obt=a+b+d+e+f+g;
avg=obt/6;


printf("Average of marks is : %.3f",avg);
percentage=(obt*100)/total;
printf("	\nPercentage of marks is : %.2f",percentage);
if(percentage>=90)
{
printf("	\n::::::::::::::::::::::::::::::::::::::::");
printf("	\n\tyour grade is:A");
printf("	\n\tcongratulations:) you scored A grade in your exams");
printf("	\n=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-==-=");
}
else if(percentage>=80)
{printf("	\n---------------------------------------");
printf("	\n\tYOur grade is:B");
printf("	\n\tYou have passsed the exams");
printf("	\n---------------------------------------");
}
else if(percentage>=70)
{printf("	\n---------------------------------------------------------");
printf("	\n\tyour grade is:C");
printf("	\n\tYou have passed the exams");
printf("	\n--------------------------------------------------------");
} else if(percentage>=60)
{
printf("	\n-----------------------------------------------------------");
printf("	\n\tYour grade is:D");
printf("	\n\tYou have passed the exams");
printf("	\n------------------------------------------------------------");
}
else if(percentage<60)
{
printf("	\n----------------------------------------------------------------------------------------");
printf("	\n\tYour grade is:F");
printf("	\n\tI Am sorry but you are fail");
printf("	\n----------------------------------------------------------------------------------------");
}


printf("	\n******************************");
printf("\ntotal MArks \t OBtained marks");
printf("\n %.1f",physics,"\t %.1f",a);
printf("\n %.1f",maths,"\t %.1f", b);
printf("\n %.1f",computer,"\t %.1f",d);
printf("\n %.1f",english,"\t %.1f",e);
printf("\n %.1f",urdu,"\t %.1f",f);
printf("\n %.1f",pakstudies,g);
printf("	\n**************************");
getch();
}

推荐答案



这篇关于你好!世界C程序问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 10:29