#include <stdio.h>
void foo(int *p, int x){
*p = x;
}
int main(){
int *z;
int a = 20, b = 25;
z = &a;
foo(z, b);
printf("%d", a);
return 0;
}
#include <stdio.h>
void foo(int *p, int x){
*p = x;
}
int main(){
int *z;
int a = 20, b = 25;
z = &a;
foo(z, b);
printf("%d", a);
return 0;
}
foo(int *p, int x) takes a pointer to an integer p and an integer x. It sets the value pointed to by p to x. This operation means that the integer at the memory location p is updated to x.main(), two int variables a and b are initialized with values 20 and 25 respectively.z is assigned the address of a (z = &a;), making z point to a.foo is called with arguments z and b. Since z points to a, calling foo(z, b) effectively sets a to the value of b, which is 25.printf statement outputs the value of a.a is modified to 25, the output of the program is 25, which falls within the specified range (25, 25).Which of the following initialization statement store six integer values in array?
Which of the following expression will delete the entire array pointed to by q?
Consider the following C program segment.
#include <stdio.h>
int main()
{
char s1[7] = "1234";
char *p;
p = s1 + 2;
*p = '0';
printf("%s", s1);
return 0;
}
What is the output the given C language code snippet?
#include<stdio.h>
int main()
{
int x[] = {10,20,30};
int *p = x;
p++;
printf("%d",*p);
return 0;
}