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
@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
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
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
@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
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
@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
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
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
@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 ,
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
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
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
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
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
+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
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
#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
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
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
@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
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
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
#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--);
}
#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
25 matches
Mail list logo