ice solution... very simple too.
> it gives the desired solution as required..though it is a case of indirect
> recursion... but still a nice aproach...
> keep it up
> thanks.
> Regards
> Divesh
>
> On Thu, Sep 23, 2010 at 12:45 PM, aswath G B wrote:
>
>
@Dave
Slight change u have to do
#include
main()
{
int a = 24;
int b = (a | 7)+1; //This Line U have to change.& not a || 7.
printf("%d",b);
return 0;
}
tats it
btw it is nice one line easy soln...
On Sat, Sep 25, 2010 at 10:17 PM, Dave wrote:
> answer = (x || 7) + 1;
>
>
#include
void f1(int);
void f2(int);
int val;
main()
{
printf("Enter number\n");
scanf("%d",&val);
f1(1);
return 0;
}
void f1(int m)
{
if(m <= val)
{
printf("%d\n",m);
m++;
f2(m);
}
}
void f2(int n)
{
if(n <= val)
{
printf("%d\n",n);
n++;
f1(n);
}
}
I think this prog is correct..
head -10 as.c | tail -6
Sample O/P
r...@hp-laptop:~/ds# *cat as.c*
#include
int main()
{
char a;
int b;
short c;
double d;
clrscr();
a=b=0;
c=d=1;
a++;--b;c++;--d;
printf("%p,%p,%p,%p",a,b,c,d);
}
r...@hp-laptop:~/ds# *head -10 as.c | tail -6*