سلام
انا جربت هذه الطريقة بس يقول انه عندي غلط ايش هو الله اعلم فارجو من احد ما ان يقول ما هو الخطأ
(( ^_^ انا كمان معايا هذا الواجب ^_^ ))
كود:
#include<stdio.h>
int main(void)
{
int id, g;
char lg,a,b,c,d,f;
printf("pleas enter your id and your grade :");
scanf("%d%d", &id, &g);
{
if (g >= 90)
lg==a;
else if (g>=80)
lg==b;
else if (g>=70)
lg==c;
else if (g>60)
lg==d;
else
{lg==f;}
}
switch (lg)
{
case 1:
Printf("\nyour id is %d and your grade = %d and lg = %c",id,g,lg);
break;
default:
Printf("\npleas try again....\n");
}
return(0);
}
الكلام هو
------ build started: Project: Test, configuration: Debug win32 ------
compiling...
Test.c
c:\s and settings\wooow\my s\visual studio 2008\projects\test\test\test.c(9) : Warning c4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _crt_secure_no_warnings. See online help for details.
C:\program files\microsoft visual studio 9.0\vc\include\stdio.h(306) : See declaration of 'scanf'
c:\s and settings\wooow\my s\visual studio 2008\projects\test\test\test.c(13) : Warning c4553: '==' : Operator has no effect; did you intend '='?
C:\s and settings\wooow\my s\visual studio 2008\projects\test\test\test.c(15) : Warning c4553: '==' : Operator has no effect; did you intend '='?
C:\s and settings\wooow\my s\visual studio 2008\projects\test\test\test.c(17) : Warning c4553: '==' : Operator has no effect; did you intend '='?
C:\s and settings\wooow\my s\visual studio 2008\projects\test\test\test.c(19) : Warning c4553: '==' : Operator has no effect; did you intend '='?
C:\s and settings\wooow\my s\visual studio 2008\projects\test\test\test.c(21) : Warning c4553: '==' : Operator has no effect; did you intend '='?
C:\s and settings\wooow\my s\visual studio 2008\projects\test\test\test.c(25) : Warning c4700: Uninitialized local variable 'lg' used
build log was saved at "file://c:\s and settings\wooow\my s\visual studio 2008\projects\test\test\debug\buildlog.htm"
test - 0 error(s), 7 warning(s)
========== build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
واشكرك يا مستر احمد على كل دروسك فقد كانت اكثر من كافية