Just shift left the number by 1.
main()
{
int x=6;
printf("%d\n", x<<1); /* Multiply by 2 */
printf("%d\n", x<<2); /* Multiply by 4 */
}
Output:
12
24
main()
{
int x=6;
printf("%d\n", x<<1); /* Multiply by 2 */
printf("%d\n", x<<2); /* Multiply by 4 */
}
Output:
12
24
No comments :
Post a Comment