- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
student
- Interests
- c++ programming, painting, reading novels and ofcourse studying...
25 Posted Topics
i have made the following program but i cant find what is the error... the output is not coming correct... for example Enter A Binary Number 110011 Number of ones are 0 Number of zeroes are 1 [code] void main() { clrscr(); int r, ones=0, zeroes=0; long int n; printf("Enter … | |
Re: what i think you can do is save each value of int(word[x]) in an integer array... and then add them like 104*1000+105=sum and then if it is ghi 103*pow(10, 6)+sum=sum...and so on... thats just my idea... there can be a better way...!! | |
Re: instead of line 9, you should use a for loop to get the values for the integer array list... and as WaltP said you have not read an integer count...it should have been read before line 8... line 10 too is incorrect...you dont display an integer array like that...you have … | |
i have made a program on text file to remove extra blank spaces in a file but it is not working correctly. when i run the program just "enter text" appears and after entering the text the screen just remains as it was. Nothing else appears. I cant find where … | |
Re: can you post the corrected code?? i.e. the code after using matrices?? | |
Re: line 20 and 21...are you sure we can read data from a binary file like that??? | |
| |
Re: post what you have done so have or what steps you are thinking to solve the problem... then only we will be able to help you... | |
i am making a menu driven program on linked lists. the program's display function is printing garbage values. i.e if n=3...i add three values and when the values are displayed the last entry is displayed and the rest two enteries are garbage values for eg. [QUOTE]MENU (Linked List) 1. CREATE … | |
Re: can you tell the input for which the output is coming wrong? because when i tried N as 4, A as 1 and R as 2... output came correct... and in second line include has wrong spellings...it must be giving errors when compiled... and one more thing please wrap code … | |
Re: put the whole thing you want to repeat in a do- while loop... ask each time before the loop ends if the user wants to play again... and keep a count of no. of times the loop runs...that would be no. of games played... sum up noOf guesses..like [code] int … | |
i have made a menu driven program for selection sort, bubble sort and insertion sort.. the first two are working correctly but despite writing the correct code (according to me, i have checked my code many times) the insertion sort is not giving the desired output.. here's my piece of … | |
Re: [QUOTE=bujoldea;458366]i've enumerated the months with the number of days in each month how do i rig it so that what ever the user types for their two months counts the number of days in the months between? could i use a for loop like: for (int i=first month; i<last month; … | |
| |
hello everybody... i am trying to make a project on binary files and that needs a function to modify data in a binary file. I have made the following class. [code] class example { public: char name[10], number[5]; void getdetails(); void showdetails(); example() { name[0]='\0', number[0]='\0'; } char* getname() { … | |
Re: [code] for(int i=0; i<noofstudents; i++) [/code] i think this will help you out assuming noofstudents contains the value for the no of times you want to run the loop...or i.e no of students of type studentdata... | |
Re: by the way why dont you use getch() at the end of the main function. It will wait for the user to press enter before the program closes. you have to include header file conio.h for that [code] int main () { int a; cout << "Hello World"; cin>>a; getch(); … | |
Re: yes i totally agree with hekkbomber you cannot use == for strings and should use strcmp... for further information about the strcmp function, you can read from the following link.. [URL="http://www.cplusplus.com/reference/clibrary/cstring/strcmp.html"]http://www.cplusplus.com/reference/clibrary/cstring/strcmp.html[/URL] | |
Re: sorry but i dont know the game... so can i have a little bit of information?? are the three groups fixed and already made?? if so what you can do is first read a integer from the file while(!end of file) and then compare let the read integer be n … | |
Re: you should put your line number 39 in a for loop [code] for(int j=0; j<i; j++) DisplayArrays(studentNames[j], scores[j]); [/code] and remove line 8 and 9 f4m displayarrays function and add in main b4 for loop or it will be displayed everytime the function iz called... | |
Re: hmm...u dont know the arrays part... i think u cn try this.. [code=c++] [B]int min, max;[/B] cout << "Enter random number " << numCount << ": "; cin >> numbers; [B]min=numbers; max=numbers;[/B] while (numbers !=-99) { numAccum += numbers; numCount++; cout << "Enter random number " <<numCount << ": "; … | |
the last record is getting displayed twice.i hv rechecked everything and cudnt find the error. here is the add n display function. [code=c++] void add() { example abc; int n; ofstream file1("EXAMPLE.dat", ios::binary|ios::app); cout<<"Enter Number Of Records To Add "; cin>>n; cout<<endl; for ( int i = 0; i < … | |
Re: u cn simply use BMI as a float variable... float BMI; | |
Re: try fout.open("Library.txt", ios::app); i use it n it works.... | |
hello everybody, I am a beginner in C++. I got a CD with a C++ how to program,fifth edition book by Deitel which has the source codes included in the books. The source code for ATM case study is in parts i.e. user defined header files r dere which includes … |
The End.