Computer Science, asked by shleshamogli, 4 months ago

9) Write an output for the following program after showing proper rough work.
#include<stdio.h>
void main()
{
int a=5,5-10,c;
c = a*b;
a = b%3;
b=5!=10;
c+= 5;
printf("%d",a);
printf("\n%d",b);
printf("\nc-%d",c);
}​

Answers

Answered by MehakThakran
0

C Advanced Pointer

12

Question 1

void fun(int *p)

{

  int q = 10;

  p = &q;

}    

   

int main()

{

  int r = 20;

  int *p = &r;

  fun(p);

  printf("%d", *p);

  return 0;

}

Run on IDE

A

10

B

20

C

Compiler error

D

Runtime Error

C Advanced Pointer    

Discuss it

Question 2

Assume sizeof an integer and a pointer is 4 byte. Output?

#include <stdio.h>

 

#define R 10

#define C 20

 

int main()

{

   int (*p)[R][C];

   printf("%d",  sizeof(*p));

   getchar();

   return 0;

}

Run on IDE

A

200

B

4

C

800

D

80

C Advanced Pointer    

Discuss it

Question 3

#include <stdio.h>

int main()

{

    int a[5] = {1,2,3,4,5};

    int *ptr = (int*)(&a+1);

    printf("%d %d"

Similar questions