المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : whats wrong now ?!



Darkseeker
09-03-2004, 10:36 AM
#include<stdio.h>
int main();
{
int sum,no1,no2;
printf("enter the num:\n");
scanf("%d%d",&no1,&no2);
sum=no1+no2;
printf("the sum=%d",sum);

}

Guys where is the error cuz i cant find 1

--------------------Configuration: Cpp1 - Win32 Debug--------------------
Compiling...
Cpp1.cpp
C:\Documents and Settings\The Dark Sin\My Documents\Cpp1.cpp(3) : error C2447: missing function header (old-style formal list?)
Error executing cl.exe.

Cpp1.obj - 1 error(s), 0 warning(s)

المنصور (اليمن)
09-03-2004, 03:21 PM
أخي العزيز خطأك هو صغير لكنه مهم جداً وانتبه مرة أخرى لمثل هذا الخطأ
الخطا هو أنك أضفت فاصلة منقوطه بعد اسم main method وهذا خطأ
void main();
هذا هو خطأك فقم بإزالة هذا الفاصلة المنقوطة وسيعمل البرنامج بنجاح

The wrong is : you add semicolon after main method where this isn't allowed

مع تحياتي

Darkseeker
09-03-2004, 05:04 PM
Thx very much man9or for ur help it worked now ^^