Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+5
Strength to Decrease Rep
-1
26% Quality Score
Upvotes Received
3
Posts with Upvotes
3
Upvoting Members
3
Downvotes Received
12
Posts with Downvotes
6
Downvoting Members
9
3 Commented Posts

39 Posted Topics

Member Avatar for Nikhar

Hi everyone, This might be a very stupid question to ask and the answer might be very simple but I was just curious to know this. How to display "\n" on output screen in C++? We all know \n is used to enter a new line. But what if I …

Member Avatar for rubberman
0
2K
Member Avatar for Nikhar

Hi, Suppose there's a weighted undirected graph G(V,E) where each weight is the distance between two vertices. I have to visit all the vertices of the graph such that the total distance travelled is minimum. Is this an instance of Traveling Salesman Problem? Following is the amount of work that …

Member Avatar for Momerath
0
172
Member Avatar for Nikhar

I am writing a c++ code (or any sort of code for that matter) after one complete year. And yet I don't think I could have become so bad that I can't make a Hello World program. Still, here I am with so many errors. Here's the code:- [CODE]#include <iostream> …

Member Avatar for pc75
0
3K
Member Avatar for Nikhar

I am a newbie, in crafty as well as js, so pardon me if I might have made very silly errors in the following program. What is wrong with the following code? The following code is supposed to create 5*5 matrix where each block would be a 60 pixel high …

Member Avatar for Nikhar
0
222
Member Avatar for Nikhar

The following is my code for Edit Distance problem. The problem asks us to find the edit distance between two strings. My code, I think gives the correct output. If I run the code with two strings of 1500 length each, I get the error. But if I run it …

Member Avatar for Nikhar
0
351
Member Avatar for Nikhar

While it is true that the inorder traversal of a binary search tree produces a sorted output, is the converse also true, i.e., if the inorder traversal of a binary tree is sorted, then is it necessarily a binary search tree?

Member Avatar for deceptikon
0
112
Member Avatar for Nikhar

Firstly, I am not sure if this is the best place to ask the query. If no, please move it to the correct subforum. Now, coming to my doubt, an assembler converts assembly language into opcodes, right? Now, to perform the conversion, assembler needs a certain algorithm. Whats the algorithm …

Member Avatar for deceptikon
0
182
Member Avatar for Nikhar

Ok... i ran my quicksort program on my college lab's machine (i dunno its config) and it took 4 seconds on avg to sort 1 million elements. I ran it on my lappy (4 gb RAM, Intel Core i5-2410M Processor (2.3 GHz)) and it took 0.83 seconds to run the …

Member Avatar for deceptikon
0
114
Member Avatar for Nikhar

The following is the problem to which I am attempting a solution (in fact I have found the solution, there's a small doubt in a concept):- [quote] Q4) Given a floating point number, write a program to convert it into its lowest irreducible fractional form. Note that the total number …

Member Avatar for Nikhar
0
236
Member Avatar for Nikhar

Recently.. I noticed that I can't access a few of my fb apps that were location specific. When I dug a little deeper, i found out that my computer was showing an IP Address that was from US. But I live in India. I used the folowing two trackers:- [url]http://www.ipaddresslocation.org/[/url] …

Member Avatar for smferoz
1
801
Member Avatar for Nikhar

Hey...guys while downloading one of the files I got a whopping 100 seeds.... and a sucking 20kbps download speed! I am very new to the world of torrents...in fact only began yesterday. So, I do not have much idea about torrents. I have a few questions. Firstly, the rate at …

Member Avatar for orwell84
0
234
Member Avatar for arkarjun
Member Avatar for Fbody
-8
238
Member Avatar for Nikhar

Hey guys, I have got a C++ competition tomorrow and it is very important for me. Following are few of the questions from past years. Please, please, pleeeasse read them and guide me on how do I solve them so that I get some preparation for tomorrow [url]http://pastebin.com/m226a46ab[/url] [url]http://pastebin.com/m79b943db[/url]. [url]http://pastebin.com/m370be9ea[/url] …

Member Avatar for tux4life
-6
194
Member Avatar for Nikhar

Hi guys, can you please describe the knapsack algorithm in English. I googled this, the first page was wikipedia. The algorithm there is too mathematical which doesn't help me to understand the solution. Can you please describe its algorithm?

Member Avatar for hag++
-2
62
Member Avatar for Nikhar

I have been studying graphs currently and came across a way to implement it. [code] #include<iostream> #include<vector> #include<string> #include<map> #include<functional> #include<cstdlib> using namespace std; struct vertex; struct edge { vertex *dest; double cost; edge(vertex *a=NULL, double b=0) { dest=a; cost=b; } }; struct vertex { string name; vector<edge> adj; vertex(string …

Member Avatar for Nikhar
-1
110
Member Avatar for Nikhar

"Hasn't this guy herad of google?"The first thing that must've come into your mind when you read the title. But guess what, I did google. And this is a different sort of boot disk failure. It's not the Click of Death. So, then, what's it? I'll come to the point. …

Member Avatar for mjdodd
0
183
Member Avatar for King Dede

I prefer code::blocks coz of the ease of use and the fact that well, coding in it looks so beautiful. It's just too nice. :)

Member Avatar for Stefano Mtangoo
0
324
Member Avatar for Nikhar

Hi... I'm trying to study graphs but I cant find a good tutorial on it. I googled it, but couldn't find what I needed. Can you please suggest me a good tutorial on graphs in c++. I am basically looking for how a graph class is implemented in c++, an …

Member Avatar for Nikhar
0
139
Member Avatar for kenoch
Member Avatar for soloice

There are quite a few errors in the program. Firstly, you don't mention the data type when you call a function. So, in your function main:- [CODE]encrypt(string text, string message)[/CODE] is incorrect. It should be [CODE]encrypt(text, message)[/CODE] And more importantly, you haven't declared text and message!

Member Avatar for soloice
0
90
Member Avatar for rohitn

As far as I know delete does not return anything whereas new returns a pointer. For example, when you write--> [CODE]new int;[/CODE] A block of int is allocated in memory and a pointer is returned that points to the beginning of this block in the memory. So, if you want …

Member Avatar for Nikhar
0
100
Member Avatar for Nikhar

I have made a program to the follwoing problem:- [QUOTE] Another chessboard puzzle (this one reputedly solved by GAUSS at the age of four) is to find a sequence of moves by a knight that will visit every square of the board exactly once. Write a backtracking program that will …

Member Avatar for Nikhar
0
174
Member Avatar for Nikhar

Hi guys...I am learning binary trees and its quite interesting. But I am unable to make4 a the delete a node function in it. Whenever I try to delete a node, a fatal error occurs and the program closes. Can you please point the error out for me in the …

Member Avatar for Nikhar
0
126
Member Avatar for Nikhar

Each year IARCS organizes a series of competitive exams based on computing languages. I have great passion for computers and hence it is natural that I was attracted towards it. Anyways, to cut the long story short, I was selected in ZCO 2010 and I have qualified for INOI 2010. …

Member Avatar for Nikhar
0
93
Member Avatar for Nikhar
Member Avatar for Nikhar
0
65
Member Avatar for Nikhar

Hey guys...I have delayed asking this for too long but maybe its high time. My UPS faced some problems and it would automatically close down. So, basically windows was shut down improperly. Now, the problem is that my computer wont run chkdsk and thereare lots of damaged files. I tried …

Member Avatar for Nikhar
0
130
Member Avatar for Nikhar

Note:- I am NOT asking you to write the program for me. I am NOT asking you to do the homework for me either. All I am asking you is if you could suggest an algorithm for me. Present below are two algorithms. Can you please suggest me an algorithm …

Member Avatar for nezachem
0
132
Member Avatar for Nikhar

Hey guys...Can you please help me explain what does returning an istream object mean. I am currently studying Accelerated C++ and at many places a function returns istream object. What does it mean? For example:- [CODE]istream& read(istream& is, Student_info& s) { // read and store the student's name and midterm …

Member Avatar for Nikhar
0
2K
Member Avatar for Nikhar

Is codeblocks an ANSI compiler compatible with gcc/g++/gpp (the GNU C/C++ Compilers)?

Member Avatar for jbennet
0
155
Member Avatar for Nikhar

Hi....it seems my firefox and my opera has gone barmy. Opera would automatically open new tage and in theadress bar, I would see this--> opera:illegal-url-2. Firefox would open a new window with loads of tags in it and c:/directory in each of them. Can anyone help me?

0
57
Member Avatar for Nikhar

[code] #include<iostream.h> #include<conio.h> class suitcase { int sno[20]; long double amount[20]; public: suitcase(); void print() { int i; for(i=0;i<=19;i++) cout<<amount[i]<<'\n'; } }; suitcase::suitcase() { amount[20]={0.25,1.0,10.0,100.0,250.0,500.0,1000.0,5000.0,10000.0,50000.0, 100000.0,200000.0,300000.0,400000.0,500000.0,1000000.0, 2500000.0,5000000.0,7500000.0,10000000.0}; } void main() { suitcase s1; s1.print(); } [/code] When I run this program, I get an error :- [quote]expression syntax in function …

Member Avatar for Nikhar
0
104
Member Avatar for Nikhar

I'll try to get this as simple as possible. The problem is fairly simple. [code] long double a=100000000; cout<<a; [/code] Well, the output this shows is "1e+08" I do not want the output to be in exponential form. Rather, I want it to be printed as "100000000". What shall I …

Member Avatar for s_sridhar
0
109
Member Avatar for Nikhar

Well, I posted a few problems here on daniweb and thank god that I did so. What I had been using till now was "rusted, naff,useless" code. But after today, I am more accustomed to what the new c++ is. Well, I am 16 years old and am studying in …

Member Avatar for siddhant3s
0
335
Member Avatar for Nikhar

Hi everyone. Can anyone please guide me on how can I generate a random number from a group of prset numbers. For example:- There is a group of preset numbers:- 1,5,18,100,127,500,626,929. I want to generate a random number from this group....is there anyway in which we could do this?

Member Avatar for Nikhar
0
359
Member Avatar for Nikhar

Hi all. I'm trying to make a program where there is an array of 20 elements. Now, numbers from 1 to 20 will be assigned in a random order in the array. This is my code:- [code] #include<iostream.h> #include<conio.h> #include<stdlib.h> #include<time.h> void main() { int i,j,random_integer,count=0,sno[20]; srand((unsigned)time(0)); sno[0]=(rand()%20)+1; for(i=0;i<=19;i++) { …

Member Avatar for siddhant3s
0
160
Member Avatar for Nikhar

Hi...ok...I want to create a menu which would have 5-6 options. Now, what I want is if the user is at the first option, if he uses the down arrow key, the cursor should move at the next option. I don't want you to write the program for me or …

Member Avatar for vmanes
0
80
Member Avatar for Nikhar

Ok...I'll try and explain this in as clearly as possible. When I click on my computers, a new window opens up. Now when I click on any of the local drives:- C,D,E or F......instead of the drive a search page is opened. I think I know the reason. In file …

Member Avatar for Nikhar
0
95
Member Avatar for Nikhar

Hi....whenever I try top open a .exe file....this is the error that I get:- The file does not have a program associated with it for performing this action. Create an association in the folder options in control menu. I tried to add a new extension as exe in file types …

Member Avatar for jbennet
0
173
Member Avatar for Nikhar

Hi...this is the code that I wrote to find a particular string from a 2-d array of characters. It prints F(for found) and N(for Not found). When I execute this program, it prints N only. [code]#include<iostream.h> #include<conio.h> char SearchString(char[5][10],char[10]); void main() { clrscr(); char str1[5][10],str2[10]; int i; cout<<"\nEnter 5 objects:-"; …

Member Avatar for Nikhar
0
136

The End.