|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming > Application Programming | |
Having trouble with this code
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#11 (permalink) | |||||||||||
|
<3 TB303
![]() |
Works very well for me:
__________________Code:
imran@pandora:~/Programming$ cat crap.c
#include <stdio.h>
int main(void)
{
int a, b, c, sum;
printf("Input three integers: ");
scanf("%d %d %d",&a,&b,&c);
sum = (((a + b + c) * 2) + 7);
printf("Twice the sum of your integers plus 7 is %d\n",sum);
}
imran@pandora:~/Programming$ cc crap.c
imran@pandora:~/Programming$ ./a.out
Input three integers: 5
9
7
Twice the sum of your integers plus 7 is 49
|
|||||||||||
|
|
|
|
#12 (permalink) | |||||||||||||
|
XBox 360 Gamer
|
what is that stuff at the top?
in any case i got it figured out. the problem was the commas in between the integers. if i had put the commas in it wouldve worked alright. i took out the commas and it worked. thanks for the help everyone!
__________________
Read and heed, The Forum T S!!!Trouble finding the FAQ page? Go Here Help us, help you. Fill out your System Specs. New to the art of Overclocking? Read these to get you started in the right direction. AMD Intel XBox Live Gamertag: Wikk3d
|
|||||||||||||
|
|
|
|
#13 (permalink) | ||||||
|
Programmer
|
Quote:
![]()
|
||||||
|
|
|
|
#14 (permalink) | |||||||||||||
|
XBox 360 Gamer
|
i see, well in any case. this next code is kicking my heineken. trying to figure it out myself though before i go seeking help.
__________________
Read and heed, The Forum T S!!!Trouble finding the FAQ page? Go Here Help us, help you. Fill out your System Specs. New to the art of Overclocking? Read these to get you started in the right direction. AMD Intel XBox Live Gamertag: Wikk3d
|
|||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|