Home
Teh ramblings [entries|archive|friends|userinfo]
Gwendolen

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

[Jun. 12th, 2007|09:13 pm]
Got a 9/10 on my C final! w00t!
link8 comments|post comment

[Jun. 10th, 2007|10:44 am]
I need help on my last assignment for my programming class. I have all the logic, I just forgot how to use -1 to end a string. and I need to put it in a function. I'm supposed to get a string of numbers from 1-9 and output a histogram. so say you enter 1 2 3 7 5 4 2 1 1 the program should output:
1: ***
2: **
3: *
4: *
5: *
6:
7: *
8:
9:


it's due tonight by midnight.
here is what i have:



int main()

{
printf("Assignment 7 Track 1 CS 133 Stephani Diamond\n");

int a[10];

int i = 0;

int j = 0;

printf("Enter a string of numbers from 1-9. -1 to end\n");
scanf("%d", &a);


for(i = 0; i < 10; i++)

{

if(a[i] > 0)

{

for(j = 0; j < a[i]; j++);

}

}printf("*");

return 0;

}
link2 comments|post comment

[Mar. 29th, 2007|10:30 pm]
So i spoke with an academic adviser today and pretty much mapped out my schedule for the next two years. I'll have my bachelor's by the time I'm 25. woohoo.
link4 comments|post comment

navigation
[ viewing | most recent entries ]