Newbie here trying to teach myself programming in c
Ok I am trying to teach myself programming in c but I am lost. I have gotten through the first few tutorials but I am stuck on this one.
I need my output to be as the following:
This program will do some computations.
The two numbers I am using in this program are 63 and 25.
The Sum of 63 plus 25 is 88.
This is what i have written so far but I am so lost on this. Can someone tell me what I am doing wrong? Please :) I am getting an error on line 12 at the {
Code:
/*mavrakp1.c */
/*Created by Colleen Mavrakos 2/7/2006 */
#include <stdio.h>
main () {
printf("This program will do some computations\n");
printf("The two numbers I am using in this program are 63 and 25.\n");
return 0;
}
{
int sum;
sum = 63 + 25;
printf ("The Sum of 63 and 25 is %i\n", sum);
}
or should it be something like this:
Code:
/*mavrakp1.c */
/*Created by Colleen Mavrakos 2/7/2006 */
#include <stdio.h>
main () {
printf("This program will do some computations\n");
printf("The two numbers I am using in this program are 63 and 25.\n");
return 0;
{
int sum;
int num1 = 63;
int num2 = 25;
sum = num1 + num2; // addition
}
I get the second one to run with no errors but the "The sum of 63 plus 25 is 88" is not showing up.