theres nothing wrong with it. you need to return 0 when youre done
http://ideone.com/cc0G9
Herd Mastodon with me:
https://linuxrocks.online/invite/ov3SKzQY
the one i did looked like this
#include<stdio.h>
#include<stdlib.h> //Header Files
#include<conio.h>
main()
{
int small_Pos, large_Pos=0;
int num=0; //Declaring & Initializing variables
int large_Neg=-99999, small_neg;
int total_Pos=0, total_Neg=0;
do
{
printf("Welcome to the program! \n "); //Welcoming prompt
printf("Please enter a number:"); //Prompt to user for input
scanf("%d", &num);
if((num > 0) && (num != 999))
{
total_Pos = total_Pos + num; //accumilating the total of the positve numbers
if(num > large_Pos) //checking to see if the entered number is greater than the largest positive number
{
large_Pos = num;
}
if(num < small_Pos) //checking to see if the entered number is less than the smallest positive number
{
small_Pos = num;
}
}
if(num < 0)
{
total_Neg = total_Neg + num; //accumilating the total of the positve numbers
if(num >= large_Pos) //checking to see if the entered number is greater than or equal to the largest negative number
{
large_Pos = num;
}
if(num <small_neg) //checking to see if the entered number is less than the smallest negative number
{
small_neg = num;
}
}
}
while(num != 999);
printf("The total of all the positive numbers is: %d \n" , total_Pos);
printf("The total of all the negative numbers is: %d \n" , total_Neg);
printf("The smallest of the positive numbers is: %d \n" , small_Pos); //Output from the program
printf("The largest of the positive numbers is: %d \n" ,large_Pos);
printf("The smallest negative number is: %d \n" , small_neg);
printf("The largest negative number is: %d \n" , large_Neg);
getch();
}
I am str88,no curves no bends.
nokia rocks(iphone too)
21.5 emachice 1080p .... intel core 2 quad q6600 ... 4gig ocz memory ....h/d 320g....gpu ati hd 5750 1gddr5..m/B..intel
Herd Mastodon with me:
https://linuxrocks.online/invite/ov3SKzQY
i use dev and borland c
I am str88,no curves no bends.
nokia rocks(iphone too)
21.5 emachice 1080p .... intel core 2 quad q6600 ... 4gig ocz memory ....h/d 320g....gpu ati hd 5750 1gddr5..m/B..intel
http://ideone.com/samples#sample_lang_11 is interesting.
Herd Mastodon with me:
https://linuxrocks.online/invite/ov3SKzQY
Taking a break from Codeblocks for awhile. Looking for something that gives more understandable feedback. Right now Pelles' C for Windows is where it's at; along with MinGW+LLVM/Clang.
I didn't want to post this in a non-functional state. But seeing as Windows being a battyman with its "issues", here it is:
http://ideone.com/vYKgu
I was asking my lecturer if it would have been easier to use multiple module files. She advised against it. Now this is turning out to be one massive dish of spaghetti.
Herd Mastodon with me:
https://linuxrocks.online/invite/ov3SKzQY
i did that same course work too
I am str88,no curves no bends.
nokia rocks(iphone too)
21.5 emachice 1080p .... intel core 2 quad q6600 ... 4gig ocz memory ....h/d 320g....gpu ati hd 5750 1gddr5..m/B..intel
http://ideone.com/vvX2T
Menu 5 is skipping the first structure array member. Why? I am going to get some sleep.
Herd Mastodon with me:
https://linuxrocks.online/invite/ov3SKzQY