Friday, March 07, 2008

Programming Headaches

So...here I am trying to make things right. Let's take a look...

include
Main(void)
{
int A, a, sumInt;
flaot B, divFloat;
character c;

printf("\n Type a character A or a: ");
scanf("%f", &c);
if(c=A){
printf(" you have typed '%c' \n", c);
}else{
printf(" you have typed '%c' \n", c);
}

printf("\n Type integer numbers for A and a: \n");
scanf("%d", &A, &a);
sumInt = A+a;
printf(" Sum of A(%d) and a(%d) is %d \n", A,a, sumInt);

printf("\n Type a float number for B: \n");
scanf("%d", B);
divFloat = A*B;
printf(" A(%d) over B(%f) is %f \n",A,B, divFloat);
divFloat = A/a;
printf(" A(%d) over a(%d) is %f \n",A,a, divFloat);
divFloat = float A/a;
printf(" A(%f) over a(%d) is %f \n",A,a, divFloat);
}


and this is what i made it..

#include
#define d 0
#define D 0
Main(void)
{
int A, a, sumInt;
float B, divFloat;
char c;

printf("\n Type a character d or D: ");
scanf("%c", &c);
if(c=D){
printf(" you have typed '%c' \n", c);
}else{
printf(" you have typed '%c' \n", c);
}

printf("\n Type integer numbers for A and a: \n");
scanf("%d", &A, &a);
sumInt = A+a;
printf(" Sum of A(%d) and a(%d) is %d \n", A,a, sumInt);

printf("\n Type a float number for B: \n");
scanf("%f", &B);
divFloat = (float) A*B;
printf(" A(%d) over B(%f) is %f \n",A,B, divFloat);
divFloat = (float) A/a;
printf(" A(%d) over a(%d) is %f \n",A,a, divFloat);
divFloat = (float) A/a;
printf(" A(%d) over a(%d) is %f \n",A,a, divFloat);

}


but no..it just can't compile!!

blabberings 08..

No comments: