include <stdio.h>
include<conio.h>
void main ()
}
int num1,num2,sum;
sum=num1+num2;
printf("enter the first number/n");
scanf("%d",&num1);
printf("enter second number/n");
scanf("%d",&num2);
printf("the sum is, sum");
getch();
}
include <stdio.h>
include<conio.h>
void main ()
}
int num1,num2,sum;
sum=num1+num2;
printf("enter the first number/n");
scanf("%d",&num1);
printf("enter second number/n");
scanf("%d",&num2);
printf("the sum is, sum");
getch();
}
I dont have a s/w to test it but:
printf("the sum is, sum"); should be
printf("the sum is %d", sum);
I'll have to check it out still. do you see the error above?
Last edited by Utech22; Sep 26, 2008 at 06:33 AM. Reason: correction
|--- www.RealJamaicaEstate.com ™ ---|
Invest small = small returns [micro enterprise] | Invest Big = returns Big [macro enterprise]
--- www.fashionsJAMAICA.com ™ -|- www.ChampsJamaica.com ™
1st of all u r mixin c++ with c libraries which is wrong, if u r using c u use stdio.h if u use c++ u use iostream. This is C code below
#include <stdio.h>
#include <conio.h>
void main (void)
{
int n = 0, m = 0;
float total = 0.00;
scanf("%d", &m);
scanf("%d", &n);
total = n+m;
printf("%d",total/2);
getch();
}