Click To Get Off-Campus Placement Jobs Info !!!
FREE!!! Latest Nagarro FULL Aptitude Mock Test for Practice
Practice 5+ Mettl Aptitude Mock Test

Interview Questions and Answers :: Broadcom Ltd

Home > Experience Archives > Broadcom Ltd > Interview Question Set 2
Telephonic Round

    1 / 11

    Briefly Introduce yourself.

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    2 / 11

    Write a statement which will increment the pointer value to 10 on doing ptr++
    int arr[100];
    int *ptr;
    /* do something here*/
    ptr++; // This should incrememnt ptr value by 10 location.

    Answer:

    int main(){

    int x=3;

    int *ptr=&x;

    printf("%d\n", ptr);

    char *p = (char*)ptr;

    p+=10; //increments pointer by 10 bytes

    ptr = (int *)p;

    printf("%d\n",ptr);

    }

    Please Login First :
    Tags:

    No Tags on this question yet!

    3 / 11

    What is Structure padding. What is use of it. How to resolve without actual pragma directive

    Answer:

    http://www.firmcodes.com/structure-padding-and-packing-in-c-example/

    Please Login First :
    Tags:

    No Tags on this question yet!

    4 / 11

    What is volatile const?

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    5 / 11

    char *ptr = \"hello word\"";

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    6 / 11

    What does below do?
    int *ptr = (int *)malloc (0);

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    7 / 11

    Write program to toggle given range of bits in unsigned 32bit integer

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    8 / 11

    Write program to update 0xCD to given unsigned 32bit integer like 0xABABABAB to 0xABABCDAB

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    9 / 11

    What is function pointers and write prototype of a function which takes 2 pointer integers and return a pointer integer

    Answer:
    int * (*fun)(int *,int *)
    Please Login First :
    Tags:

    No Tags on this question yet!

    10 / 11

    In singly linked list, how to get last but 3 rd element. write program

    Answer:
    No Discussion on this question yet!
    Please Login First :
    Tags:

    No Tags on this question yet!

    11 / 11

    Declare 1 bit variable and print it.

    Answer:
    typedef struct size_t
    {
        unsigned x:1;
    } size_1;
    Where you have told the compiler that you'll only be using one bit of x.

    But due to structure packing arrangements (the C standard is intentionally flexible in order that compilers can optimize according to the machine architecture), it may well turn out that this still occupies as much space in memory as a regular unsigned and an array of  size_1 doesn't have to be bitwise contiguous.

    Generally, the smallest addressable chunk of data in C is a byte. You can not have a pointer to a bit, so you can not declare a variable of 1 bit size, But above can be one way to have 1 bit size.
    Please Login First :
    Tags:

    No Tags on this question yet!