Another solution which works for negative numbers too
#include<stdio.h>
int main()
{
int a = 1; // Operand 1
int b = 2; // Operand 2
int c; //result comes here
__asm__ __volatile__ ("addl %2, %0" : "=r" (c) : "0" (a), "r" (b));
printf("%d",c);
return 0;
}
@akshat I have a given an explanation above.
On Mon, Aug 29, 2011 at 3:31 PM, Akshat Sapra <[email protected]> wrote:
>
>
>>
>> can you please tell me how is this working
>>
>>
>>> main()
>>> {
>>> int a=4,b=6;
>>> printf("\n%d\n",printf("%*s%*s",a,"",b,""));
>>> }
>>> --
>>> Saurabh Singh
>>> B.Tech (Computer Science)
>>> MNNIT ALLAHABAD
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Algorithm Geeks" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/algogeeks?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>
>
> --
>
>
> Akshat Sapra
> Under Graduation(B.Tech)
> IIIT-Allahabad(Amethi Campus)
> --------------------------------------
> [email protected]
> [email protected]
> [email protected]
> [email protected]
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
--
Saurabh Singh
B.Tech (Computer Science)
MNNIT ALLAHABAD
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.