a simple question about c

Hi. Im just beginner about programming and i have problem about c. I hope you can help me. I use Devc/cpp. when i wrote my codes seems no warnings or errors. Its running. but while its running, sudenly coming an error about windows. "windows stopped the program". Why? I think its not about my codes because which one i try, seems same error. hope you will answer me fastly cause i have an exam next week, thanks...

[code]
#include <stdio.h>
int main ()
{
int vize,final;
float ortalama;
printf ("vize notunu giriniz\n"); scanf("%d",vize);
printf ("final notunu giriniz\n"); scanf ("%d",final);
ortalama= vize*0.4+final*0.6;
if (ortalama>=90)
printf ("TEBRÄ°KLER AA ALDINIZ");
else if (ortalama>=80 && ortalama <90)
printf ("AB ALDINIZ");
else if (ortalama>= 70 && ortalama < 80)
printf ("BA ALDINIZ");
else if (ortalama>=60 && ortalama < 70)
printf ("BB ALDINIZ");
else if (ortalama>=50 && ortalama <60)
printf ("CB ALDINIZ");
else if(ortalama>=40 && ortalama <50)
printf ("CC ALDINIZ");
else if (ortalama <40)
printf ("KALDINIZ");
return 0;
}
1. scanf() needs a variables address instead of its value:

scanf("%d", &vize);

The same with your final scanf() call.

(2. You've forgotten the closing [/code]-tag.)
Last edited on
Topic archived. No new replies allowed.