سلام
انا جربت هذه الطريقة بس يقول انه عندي غلط ايش هو الله اعلم فارجو من احد ما ان يقول ما هو الخطأ
(( ^_^ انا كمان معايا هذا الواجب ^_^ ))
كود:
#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 ==========
واشكرك يا مستر احمد على كل دروسك فقد كانت اكثر من كافية