为您找到"
#include <stdio.h> void main(){ int a[4][5]={1,2,4,-4,5,-9,3...
"相关结果约100,000,000个
output 2,3,3.....first time x=4 fine. y=--x, means value of x is decremented by 1 and stored in y, thus now y=3 and x is also 3. then z=x-- means value of x is stored in z( z=3) and then x is decremented i.e now x=2 but z=3. when u r printing the value, then printf() prints 2 3 3
Step 1: int i = 0; here variable i is an integer type and initialized to '0'. Step 2: for(; i<=5; i++); variable i=0 is already assigned in previous step. The semi-colon at the end of this for loop tells, "there is no more statement is inside the loop". Loop 1: here i=0, the condition in for(; 0<=5; i++) loop satisfies and then i is incremented by '1'(one) ...
1. What will be the output of following program? #include int main() { int a = 5, *b, c; b = &a; printf("%d", a * *b * a + *b); return (0); } Options: 1. 130 2. 103 3. 100 4. 310 The answer is the option(1). Explanation: Here the expression a**b*a + *b uses pointer in C
It does not work. Try replacing "int *p;" with "int *p = NULL;" and it will try to dereference a null pointer. This is because fun() makes a copy of the pointer, so when malloc() is called, it is setting the copied pointer to the memory location, not p. p is pointing to random memory before and after the call to fun(), and when you dereference it, it will crash.
Consider the following C program. #include <stdio.h> int main () { int a[4] [5] = {{1, 2, ... return(0); } The output of the program is _______.
Consider the following C program #include<stdio.h> int main() { static int a[] = {10, 20, 30, 40 ... ptr); } The output of the program is _______.
Output: arr = geeks, sizeof(arr) = 17 str = geeks, sizeof(str) = 4. Let us first talk about first output "arr = geeks".When %s is used to print a string, printf starts from the first character at given address and keeps printing characters until it sees a string termination character, so we get "arr = geeks" as there is a \0 after geeks in arr[].
#include void main {int x = 5 * 9 / 3 + 9;} a) 3.75 b) Depends on compiler c) 24 d) 3 View Answer. Answer: c Explanation: None. 6. What will be the output of the following C code? #include void main {int x = 5.3 % 2; printf ("Value of x is %d", x);} a) Value of x is 2.3 b) Value of x is 1 c) Value of x is 0.3 d) Compile time ...
Keep in mind, we are incrementing the address, so now it points to the (arr+1) element in p array. That's why ptr-p returns 1. In other words, we're subtracting addresses. *ptr points to arr + 1 element. That's why the second value is also equal to 1. By doing **ptr we retrieve a value that is stored at arr+1 address and it is also 1.
Consider the following $\\mathrm{C}$ program: #include <stdio.h> void fX (); int main ... output The program will terminate with $1234$ as output