No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
6 Posted Topics
Nothing wrong with the program. I tried it at my end. Enter all ten array elements and then try. If you do'nt want to add all the elements then In the show() function change the line for(int b=0;b<=lastElement;b++) to for(int b=0;b<size;b++) ------ Pradhan
It needs always to be initialized otherwise its containt will be undefined. When you define an array. The compiler only initializes the starting address of it on the stack. It only reserves the memory space as per the size specified.
I have not gone thru the total prog. but it seems that 1. you have not initialised num[] array and at the end of the program you are comparing it with big. 2. You hv filled array candidate and not used it again. Is this the only code May be …
Please refere the following program #include<iostream.h> #include<conio.h> using namespace std; int main() { [B]int a[10]={1,2,3,4,5,6,7,8,9,10}; cin>>a[-1]; cin>>a[15];[/B] cout<<a[-1]<<" " <<a[15]; getch(); } To my surprise this code works perfectly ok. I thought it will give me some compiler error or runtime error as I am [B]writing in the array index …
On net many C++ tutorial are available you may use any one of them. Once you are finished with first then only you may start with other one, or else you will get confused
[QUOTE=jen_;636503]here it goes.. example prog. output: Input a number/s, (-) to stop: 5+6-7+8-9+1-2[B]-1[/B] -the user will input numbers, if he/she inputs a (-) number that will be the time that the program will stop. -the operations between the numbers should be + and - (alternate). how will i do the …
The End.
pradhan.nc