You get a Macintosh apple
I put in digital pen
You get a Macintosh apple
I put in digital pen
The latest version of the compiler can be downloaded from here:
http://www.borland.com/downloads/download_cbuilder.html
#include <stdio.h>
int main ()
{
int a, i;
for (a=5; a>0; a--)
{
for (i=a; i<5; i++)
{
printf("x" );
}
printf("y\n");
getchar () ;
}
Your prev code was full of non standard functions. Dont use functions like clrscr ( )
and dont use non standard headers like #include <conio.h>
You get a round neck T shirt ;)
I put in a Text editor.
Pay fine -> fine grained control
Hehe bulls eye Mr. Ancient Dragon, i must admit you really have good logical reasoning abilities.
Now lets see what you have got, or do I again get to be the one posting a question here ??? :D
Hehe giving up so easily !!!
The man starts off with zero rupees. He doesnt get any from his relatives and has no piggy bank. From day one he starts getting Rs 20 and then on the second day spends Rs 15
1 => 20
2 => 5 ( since he has spend 15)
3 => 25
4 => 10 ....
I hope you are getting the math, keep doing this till he has in his hands ( he currently holds) Rs 60.
Simple, isnt it !!! :D
I assumed that meant on which day will he have accumulated Rs 60. If that is an incorrect assumption, then please explain what it means.
Heh you sure are sharp on the uptake :D
Yes, you assumed it incorrectly, he doesnt need to accumulated Rs. 60, just that on which day he will have Rs 60 ?
at the end of every other day he will have Rs 5 left. So the answer must be (60/5) * 2 = 24th day.
Hehe wrong...
Looks like you didnt take a look at my hint, this question is not that straight forward, more like a puzzle.
BTY: what is Rs ?
Its the currency in our country (india)
Rs => rupees ( pronounced as rupiece )
Yeah i agree with Mr. Ene Uran. The inbuilt vector sort function is much more sophisticated compared to the normal sort functions in terms of both performance and interface.
The STL implementation of sort, however, uses the introsort algorithm whose worst case complexity is O(N log(N)). Introsort is very similar to median-of-three quicksort, and is at least as fast as quicksort on average.
Look here:http://www.sgi.com/tech/stl/sort.html
Hmm... lets see how good are the members of this cool community. I will start a thread in which people can ask fun puzzles which have an obvious solution and other people can try answering them along with the logic furnished with the solution. After all we need something to oil our rusty cogs up above...eh.. I'll start:
If a man earns Rs 20 on first day and spends Rs 15 on second day ,and earns Rs 20 on third day and spends Rs 15 on fourth day and goes on on which day he will be having Rs 60. HINT (This is not as easy as it looks)
SQL stands for Structured Query Language, it is more of a standard than a language. The Database packages which implement SQL are Oracle, MySQL, MS SQL Server 2005, etc. to name a few.
PHP is the server side scripting language used to impart dynamic behaviour to the web pages. And it would be a definate plus on your side if you knew the basics of SQL before attempting to tacke server side scripting languges like PHP since all the dynamic pages do is query the database in one form or the other.
It would be a different thing is you are learing PHP to develop standalone applications using the PHP GTK+. If that is the case then you dont need to know SQL.
http://www.w3schools.com/sql/default.asp
http://sqlcourse.com/intro.html
Why not? There's nothing wrong with the Borland compiler. It's when a bad compiler is in use you should change. But when you get right down to it, for the most part if it does the job, any compiler will do.
I didnt say anything is wrong with the compiler,my suggestions were purely based on personal choice, just wanted the OP to know the choices he has.
BTW since you seem to be a Borland proponent you might want to take a look here:
http://www.willus.com/ccomp_benchmark.shtml?p6
http://www.willus.com/ccomp.shtml?p03
Nothing personal, just found these when i was once looking for good compilers. ;)
Far better than me...
Hmm...
@ slake
Why stick to Borland ???
If you are thinking about compiler migration better go for the free Visual Studio 2005 free edition or for GCC mingw compiler which nowadays most of the people use.
Maybe what he wanted to do was Miccheck ...
Mr. Vegaseat would be really happy to have you here (btw he is the moderator of the python forum here).
But still given that the worst sorting time for "Quicksort" equals the time complexity of bubble sort, so it does no harm in using the fastest algorithm out there, just to keep the algo common independent of the data fed into it.
The below link is interesting to look at :
http://www.inf.fh-flensburg.de/lang/algorithmen/sortieren/sortcontest/sortcontest.htm
Warner Bros => Brothers in Arms
@Mr. WaltP : Happy to see you here in this section :D
Why not try to use an open source external library for your needs. It will provide all the kind of control you need over playing your sound. One eg. of it is Audiere.
YOu get Yogi Bear
I put in Font generator
while ( Pds > 100 ) ;
is equivalent to
while ( Pds > 100 )
{
// sit back and enjoy baby
}
Like Mr. Dragon said the variable which controls the run of your "While " loop never changes and so it goes on for infinity.
Don't say it's not on the top of my priority list. It was on my short list of things to do, but then I got sick for a couple of weeks this month. So now that I'm back, I'm finding I'm swamped with a bunch more critical things - but I will get there eventually!
Hey Miss Dani didnt know that you were sick. Sorry if my remarks hurt you, I exactly know the kind of pressure you are under. :(
@My Friend Werewolf
Hmm... just when I thought i had cornered you.... drats :D
In order to print backwards you need to store the variable "number" in some kind of array or linked list so that it can be printed backwards which will give you the required representation.
Why not try something more classy rather than using "switch" stmts;
int main()
{
int digit = 0, count = 0, tmp = 0 ;
long number = 0 ;
char buffer [BUFSIZ] = { '\0' } ;
const char* const mappings [] = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" } ;
printf ( "Enter the number: " ) ;
fgets ( buffer, BUFSIZ, stdin ) ;
int* my_digits = (int*) malloc ( sizeof (int) * strlen (buffer) ) ;
number = atol ( buffer ) ;
while ( number != 0 )
{
digit = number % 10 ;
number /= 10 ;
my_digits [count] = digit ;
count ++ ;
}
printf ("\n\nThe representation : " ) ;
while ( count > 0 )
{
tmp = my_digits [count - 1] ;
fputs ( mappings[tmp], stdout ) ;
putchar (' ') ;
count -- ;
}
return 0 ;
}
ben and jerrys => tom and jerry
If there's one thing I need to get used to in order to be succesful in the programming world is to be able to adjust and learn how to ditch the "old" softwares and storm ahead with the new ones, right?
Corrrrrrect !!! also to never give up should be one of your qualitites.
:)
That means you don't use a code editor with syntax highlighting, and would rather use notepad to write your code? Or are you a programmer at all?
Err... Wolfie, i had the same impression at the start that this is all about syntax highlighting in code but this is not about it. This topic is about using code to highlight the text if the context demands as Mr. Dave Sinkula had pointed out.
The thing about code highlighting is what Miss Dani has been thinking about, but is not on her top priority list.
You get a really expensive painting
I put in a flower.
Hi there friend, hope you enjoy your stay at Daniweb and get to learn a lot of good things :D
Oh silly me and silly you !!!
Where is the "#" symbol before the "include <stdio.h>" part of header inclusion ???
sory im complete newbie
i have
include <stdio.h> int main() { int x; for(x=1; x < 10; x++) { printf("%d\n second ", a); } return 0; }
for.c:1: error: syntax error before ‘<’ token
Hmm you are declaring the variable "x" for controlling the for loop and printing the second values but usign an undefined variable "a" for printing the desired output ?
I was just wondering what are "Referrals" and "User Notes" used for.
For eg. most of the people on this forum have zero referral but Miss Dani has many of them.
Also what is the concept behind, member groups ??
I had a look, no it is not checked. I dont know if this is in any way related to the topic, but the people who send my Contact List invitations appear in my Contact list but with a "add as buddy" written below their name ?
Even I have stopped getting the PM for the request for adding a person to the contact list. When i had joined, it used to come (if Wolfie would remember, he sent me a contact list invitation through a PM )
But nowadays there is no PM when someone wants to add me to his contact list ??
Please use code tags to make your code more readable.
Also which compiler are you using, which OS and all that...
[EDIT] I think there is some kind of logic error in your code. YOu are asked to read the pair of numbers product number and quantity sold and you just ask the user for the total number of items sold.
Also what does this:
A== $2.98;
B== $4.50;
C== $9.98;
D== $4.49;
E== $6.87;
Stand for ?
Also this stmt is incorrect
cin >> C retail; >> endl;
Try to compile your code and see the plethora of errors it gives.
Hello there buddy, enjoy your stay at DaniWeb.
Keep rocking....
Try to come up with atleast something. This forum is for asking help when you get stuck.
Basic Structure:
1. Create the necessary variables.
2. Create a while loop which keeps on asking user for input and ask him a option at the end whether he wants to continue or not.
3. After exitting the user input phase, keep a switch statement.
4. Display and Exit
I tried something called Block::Code but it's so confusing. The DOS one is just so simple!!
If you looking for free IDE's and dont want to spend money then Code::Blocks, is one of the best IDE's out there.
What do you find so confusing ??? Their site has all the resources and help required. Even i use Code Blocks, post what you find confusing and I will try to help you out if possible.
I don't know, let's say you are an newby and you suddenly feel the un underpresseble urge to post your thankword in an five year old thread, you think your first going to find out what some 'give feedback' button means?
I don't think it will decrease the number of times that happends.
But the thing is that, if we have four buttons instead of the normal three buttons which we all see at the bottom of a post with "Give Feedback" clearly written, i think even a ten year old should be able to understand that what it is intended for. If he can find out how to bump the thread he has to be able to find how to give feedback.
The kids nowadays are intelligent you know !!!
I wear it for my interview
I put in lot of polythene bags.
Hmm... will try that, but the thing is that this guy's humour always feels so insulting, cant help it though.
Still i havent as such gotten involved in any kind of flame war with him, so its best for both of us if our paths dont cross....
chocolate cake => vanilla icecream
You get your hair shaved off
I put in a box of matchsticks.
big roat dinner => dessert time
sweet jebus someone's taking this a bit too seriously.
For that I'm sending you some red candy. I hope you have a sweet tooth SOS. =)
Hmm.. i dont know what to make of this post of yours. Your answers have always mystefied me but still I would just let it pass for the time being:mad:
PHP and other server side scripting languages was specifically designed for the purpose of doing away with the cumbursome work associated with the server side scripting using C and C++.
If you anyways usign PHP functions why do you want to use C++ ?
Why not design the site using just PHP which has a lot of support and tuts on the net related to creating the site from start to end.
I think you are confusing my idea with the reputation system on forums.devshed.com.
Rep can only be given by ppl who have enough to give to others while thanksgiving can be given by any one who is impressed with the content of the post.
This will hopefully solve the matter of newbies hijacking threads just to show how helpful the specific post was to them.
The pleasure is all mine :D
Just keep up the good work.
yes but how to enter sleep in this file
#include <stdio.h> #include <windows.h> int main() { int a; int b; a = 3; b = 30; while (a < b) { printf("%d\n crap .....", a); a = a + 1; Sleep ( 2000 ) ; } return 0; }
But the thing is that the above code will work only on windows.
I havent as such personally worked on Linux but if you using Linux (like your avatar says i think) then try using the usleep (2000)
function (notice the lowercase "s") here the parameter passsed is time in microseconds.
Also dont forget to include the #include <unistd.h>
instead of the windows header.
#include <stdio.h>
#include <unistd.h>
int main()
{
int a;
int b;
a = 3;
b = 30;
while (a < b)
{
printf("%d\n crap .....", a);
a = a + 1;
usleep ( 2000 ) ;
}
return 0;
}
Hope it helped, by.e
Hi there everyone.
I have recently seen many posts in which people are really happy with the resources provided in that thread and post their thanksgiving making the thread lose its purpose. Even newbies resurrect dead threads just to say thanks.
I was wondering why not make DaniWeb a no nonsense techincal stuff site by adding a feature wherein people who like the content can give their comments without deffering from the original topic.
For eg. why not keep a "Give Feedback" and "View Feedbacks" Button at the bottom at the post wherein the user who like the thread content can press Give Feedback and post a short comment ( U can limit the size you know, eg. 255 chars) and other ppl can see the feedbacks given usig the "View Feedbacks" button.
How to you like the idea, well just call it a passing thought.
Hmm now thats some interesting news.