Re: [algogeeks] output plzz

2011-07-24 Thread sunny agrawal
Can't say but that seems to be the issue to me To get the final answer need to explore Stack contents. On Sun, Jul 24, 2011 at 12:34 PM, shady wrote: > @sunny it should have printed some garbage after 'charlie' in that case ? > that is what happens with scanf when you overwrite '\0'... isn't it

Re: [algogeeks] output plzz

2011-07-24 Thread shady
@sunny it should have printed some garbage after 'charlie' in that case ? that is what happens with scanf when you overwrite '\0'... isn't it ? On Sun, Jul 24, 2011 at 12:25 PM, sunny agrawal wrote: > char five[7] -> string of length 7 > charlie -> 7 length string > > declare it as char[8] u will

Re: [algogeeks] output plzz

2011-07-23 Thread sunny agrawal
char five[7] -> string of length 7 charlie -> 7 length string declare it as char[8] u will get expected output On Sun, Jul 24, 2011 at 12:15 PM, Anurag atri wrote: > yup , on ideone it indeed is giving the output you suggested .. > > > > On Sun, Jul 24, 2011 at 12:10 PM, sameer.mut...@gmail.com

Re: [algogeeks] output plzz

2011-07-23 Thread Anurag atri
yup , on ideone it indeed is giving the output you suggested .. On Sun, Jul 24, 2011 at 12:10 PM, sameer.mut...@gmail.com < sameer.mut...@gmail.com> wrote: > @Anrag: i am using gcc on Ubuntu.I also checkd it on Ideone online > compiler. > > > But Declare the character strings > char five[7]; > c

Re: [algogeeks] output plzz

2011-07-23 Thread sameer.mut...@gmail.com
@Anrag: i am using gcc on Ubuntu.I also checkd it on Ideone online compiler. But Declare the character strings char five[7]; char four[7]; int three; char two[7]; char one[7]; int his order and we get the correct output. But i dont know y?Its something to do with Memory location where the string

Re: [algogeeks] output plzz

2011-07-23 Thread Anurag atri
Dev c++ , which one are you using ? On Sun, Jul 24, 2011 at 12:01 PM, sameer.mut...@gmail.com < sameer.mut...@gmail.com> wrote: > No. Its not coming like dat. > > > > This is 10 times charlie > Thisis10charlie > > > This is the output > > > > > *Muthuraj R. > 4TH Year BE.** > Information Science

Re: [algogeeks] output plzz

2011-07-23 Thread rajeev bharshetty
@sameer : U r right . The Fourth string is not storing any thing, its blank .. On Sun, Jul 24, 2011 at 12:01 PM, sameer.mut...@gmail.com < sameer.mut...@gmail.com> wrote: > No. Its not coming like dat. > > > > This is 10 times charlie > Thisis10charlie > > > This is the output > > > > > *Muthuraj

Re: [algogeeks] output plzz

2011-07-23 Thread sameer.mut...@gmail.com
No. Its not coming like dat. This is 10 times charlie Thisis10charlie This is the output *Muthuraj R. 4TH Year BE.** Information Science Dept* *PESIT, Bengaluru . * On Sat, Jul 23, 2011 at 11:23 PM, shady wrote: > it is not coming like that ? > > > On Sun, Jul 24, 2011 at 11:41 AM, Anu

Re: [algogeeks] output plzz

2011-07-23 Thread shady
it is not coming like that ? On Sun, Jul 24, 2011 at 11:41 AM, Anurag atri wrote: > The output will be > This is 10 times charlie > Thisis10timescharlie > > and it makes sense , this will be helpful > http://www.cplusplus.com/reference/clibrary/cstdio/sscanf/ > > Regards > Anurag Atri > > -- > Yo

Re: [algogeeks] output plzz

2011-07-23 Thread sameer.mut...@gmail.com
@Anurag: May i know which compiler gave you the above output? *Muthuraj R. 4TH Year BE.** Information Science Dept* *PESIT, Bengaluru . * On Sat, Jul 23, 2011 at 11:11 PM, Anurag atri wrote: > The output will be > This is 10 times charlie > Thisis10timescharlie > > and it makes sense ,

Re: [algogeeks] output plzz

2011-07-23 Thread Anurag atri
The output will be This is 10 times charlie Thisis10timescharlie and it makes sense , this will be helpful http://www.cplusplus.com/reference/clibrary/cstdio/sscanf/ Regards Anurag Atri -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To pos

Re: [algogeeks] output plzz

2011-07-23 Thread sameer.mut...@gmail.com
Declare the character strings char five[7]; char four[7]; int three; char two[7]; char one[7]; int his order and we get the correct output. But i dont know y?Its something to do with Memory location where the strings are defined. *Muthuraj R. 4TH Year BE.** Information Science Dept* *PES

Re: [algogeeks] output plzz

2011-07-23 Thread shady
anyone ? On Sun, Jul 24, 2011 at 2:38 AM, Anika Jain wrote: > in this in scanf one,two, four five will b thr, no & thr.. > > and sumbody plz tell afterwards this change why the o/p is > this is 10 times charlie > thisis10charlie > > why in 'four' empty string is going?? > > > On Sat, Jul 23, 201

Re: [algogeeks] output plzz

2011-07-23 Thread priyanka goel
output of above question will be> hello h In switch we get output until a break statement is encountered.. so after printing hello it will also print h and den dere is a break statement so it will come out of while loop -- You received this message because you are subscribed to

Re: [algogeeks] output plzz

2011-07-23 Thread Anika Jain
in this in scanf one,two, four five will b thr, no & thr.. and sumbody plz tell afterwards this change why the o/p is this is 10 times charlie thisis10charlie why in 'four' empty string is going?? On Sat, Jul 23, 2011 at 9:37 PM, geek forgeek wrote: > #include > main() > { > char outline[5

Re: [algogeeks] output plzz

2011-07-23 Thread Pankaj
+1. The new group should only contain stuff related to C output and error detection and ques like that. Puzzles I think can be discussed here. wattsay? On Sat, Jul 23, 2011 at 10:44 PM, saurabh singh wrote: > Anyways just share the link on the group.I am pretty sure the interested > will join.No

Re: [algogeeks] output plzz

2011-07-23 Thread saurabh singh
Anyways just share the link on the group.I am pretty sure the interested will join.No offences but sometimes it does get irritating when you open a post with subject Help! and when you expect some good algorithm problem you find questions like -"x=++x---x+++x---x;whats the output". Whatever you dec

[algogeeks] output plzz

2011-07-23 Thread geek forgeek
#include main() { char outline[50]; char one[7],two[7],four[7],five[7]; int three; sprintf(outline,"this is %d times %s \n",10,"charlie"); printf("%s",outline); sscanf(outline,"%s %s %d %s %s",&one,&two,&three,&four,&five); printf("%s",one); printf("%s",two); pri

Re: [algogeeks] output plzz

2011-07-23 Thread shady
I will get back to you tomorrow. Thanks a lot for the feedback :) Probably can have some contests organized as well, once a month on online judges..( no prizes though ) On Sat, Jul 23, 2011 at 9:21 PM, geek forgeek wrote: > even i second this gud idea > > > On Sat , Jul 23, 2011 at 8:40 AM, same

Re: [algogeeks] output plzz

2011-07-23 Thread geek forgeek
even i second this gud idea On Sat , Jul 23, 2011 at 8:40 AM, sameer.mut...@gmail.com < sameer.mut...@gmail.com> wrote: > @shady: yes its a good idea to have aptitude puzzles etc in other group > > > On Sat, Jul 23, 2011 at 8:29 AM, shady wrote: > >> nice idea Saurabh, but i don't think much peo

Re: [algogeeks] output plzz

2011-07-23 Thread sameer.mut...@gmail.com
@shady: yes its a good idea to have aptitude puzzles etc in other group On Sat, Jul 23, 2011 at 8:29 AM, shady wrote: > nice idea Saurabh, but i don't think much people will join that group too, > and the difference should be on the basis of type of questions asked. Any > suggestions from others

Re: [algogeeks] output plzz

2011-07-23 Thread shady
nice idea Saurabh, but i don't think much people will join that group too, and the difference should be on the basis of type of questions asked. Any suggestions from others ? There we can ask questions related to debugging and puzzles, aptitude On Sat, Jul 23, 2011 at 8:51 PM, saurabh singh w

Re: [algogeeks] output plzz

2011-07-23 Thread saurabh singh
The break statement here breaks out of the do loop so the o/p hello hmmm give a break statement after hello and you will get only hello. PS:Seeing the number of C questions wont it be a better idea to start a parallel group especially for the same?My request to the group admins for the same. On S

[algogeeks] output plzz

2011-07-23 Thread geek forgeek
#include main() { int i=3; switch(i) { do { case 3: printf("\nhello"); case 2:printf("\n h"); break; case 1:printf("wat"); break; case 0: printf("hai"); }while(i--); }

[algogeeks] output plzz

2011-06-25 Thread harshit pahuja
#include #define TOTAL_ELEMENTS (sizeof(array) / sizeof(array[0])) int array[] = {23,34,12,17,204,99,16}; int main() { int d; for(d=-1;d <= (TOTAL_ELEMENTS-2);d++) printf("%d\n",array[d+1]); return 0; } y der is nothing in the output . - Regards - HARSHIT PAHUJA -- You received this m