d) What will be the result of following expression?
int p=20, k=10;
p=p*++k;
System.out.print (p="+p)
oment?
Answers
Explanation:
take help from Google because there are lots of articles in it and therefore it will surely help you
Answer:
// PROGRAM 1
#include <stdio.h>
int main(void)
{
int arr[] = {10, 20};
int *p = arr;
++*p;
printf("arr[0] = %d, arr[1] = %d, *p = %d",
arr[0], arr[1], *p);
return 0;
}
filter_none
edit
play_arrow
brightness_4
// PROGRAM 2
#include <stdio.h>
int main(void)
{
int arr[] = {10, 20};
int *p = arr;
*p++;
printf("arr[0] = %d, arr[1] = %d, *p = %d",
arr[0], arr[1], *p);
return 0;
}
filter_none
edit
play_arrow
brightness_4
// PROGRAM 3
#include <stdio.h>
int main(void)
{
int arr[] = {10, 20};
int *p = arr;
*++p;
printf("arr[0] = %d, arr[1] = %d, *p = %d",
arr[0], arr[1], *p);
return 0;
Explanation: