Google News
logo
Embedded C - Interview Questions
Write an Embedded C program to multiply any number by 9 in the fastest manner.
This can be achieved by involving bit manipulation techniques - Shift left operator as shown below:
#include<stdio.h>
void main(){
    int num;
    printf(“Enter number: ”);
    scanf(“%d”,&num);
    printf(“%d”, (num<<3)+num);
}
Advertisement