Please explain this question void main() {int a =300; char *ptr = (char*) &a ; ptr ++; *ptr =2; printf("%d", a); }
Q: int main() { } above? int a, b, c, d; 4; JO a b с d 423 22; 32; 42; if(b%a { } 0) if(c%a { } else {…
A:
Q: #include using namespace std; int main() { char str[20]; cin>>str; // the user writes: Hello world…
A: The answer is...
Q: c++ How do you declare a pointer that will hold an integer type?. Multiple choice. int *p; int…
A: To declare a pointer that will hold an integer type: To store the memory address of another…
Q: DETERMINE THE OUTPUT OF THE CODE: #include using namespace std; int main() { int i; for (i = 1; i…
A: Ans. 2 4 6 8 10 ( first option) Explanation: intialization: i = 0 condition if ( i <= 10 ) is…
Q: #include using namespace std; void myfunction(int num2,int num1); int main(){ myfunction(5,2);…
A: Please find the answer below :
Q: (5) def add_chars (some_list, some_str): Special Restrictions: You are not allowed to use loops. You…
A: Define add_chars() function to add characters in the lists. Define add_chars_helper() inner…
Q: #include using namespace std; void myfunction(int num2, int nu int main(){ myfunction(5,2); return…
A: Function declaration is done in the third line saying myfunction accepts two integer parameters and…
Q: Find the error in the following code and explain how to fix it:
A: The error in the code is in the line : ptr=m; Because ptr is a pointer variable and we cannot assign…
Q: #include • #include • main() { int d; d=CHAR_MIN; printf("%d",d); }
A: Output of the given code
Q: Define the term " pointer value " .
A: Pointer is a variable which stores address of some variable. Thus we say that pointer points to a…
Q: #include using namespace std; int main() 3 { int x,y; or (x=0; x 3) break; cout << y << endl; }}}
A: The given code consists of two nested for loops.
Q: 1) #include #include int power(int, int); int main(void) { int x, n; printf("Enter a number and…
A: To do: Write the int main(void) function as a driver program and call the above three functions…
Q: int sum (int a, int b) { return (a + b); } int main() { } Parameters int total; total = sum ( 10,…
A: Here we have given a clear explanation of the code given in C-Programming language. You can find the…
Q: #include <stdio.h>int main(){int d;int s[20],i, j, p, lg=0,m,t=0;char c;printf("Enter number…
A: The function getch() defines under <conio.h> header file, include <conio.h> header file…
Q: 8.) #include int main() { } int a; char *x; x = (char*) &a; a = 512; x[0] = 1; x[1] =2;…
A: Given: Why does this C program produce a large endian output of 258 but a little endian output of…
Q: #include <iostream using namespace st int main() int s-4; int d-s++3; cout<<d; return 0;
A: Given Code: #include <iostream>using namespace std; int main(){ int s = 4; int d = s++;…
Q: //Program 4.6 #include 1 2 3 #include 4 int main (){ char c1, с2, с3, с4; cl=65; c2='A'; c3=0x41;…
A: In this code we get error.
Q: #include #include void main(void) (int number; Cout > number; if ( number > 100) cout <<" number…
A: The above program is for checking if number>100 then a message is displayed "number is greater…
Q: (a) #include using namespace std; int main() { } for (int i = 0; i <=30; cout << i*2 << endl; }…
A: In the given code: The loop will start from i=0 For i = 0 it will print 0*2 = 0 Now i has to be…
Q: None
A: Coded in C++.
Q: //DETERMINE THE RESULT OF THE FOLLOWI #include using namespace std; int main() { int i,prod=1; i=5;…
A: According to the information given:- We have to execute and find out the correct option.
Q: #include <stdio.h>int main(){int d;int s[20],i, r, p, lg=0,m;char c;printf("Enter number of…
A: Add the statement “i+1” in the print statement: printf("salesman %d ",i+1); Add another array to…
Q: Each of the following definitions and program segments has errors. Locate as many as you can and…
A: void showValues(int nums[ ]) *// Definition of the function showValues. { for (int…
Q: C language programming .
A: Required:
Q: 8. Determine the value of variable num1, num2 and num3 at the end of the following code. int…
A: #include<stdio.h>int product(int A, int *B) /* function definition. As at the time of calling…
Q: Void Do1 (int: &, a. int &b) { a = 5; a = a + b; b = a + 2; } Int main() {…
A: We have given a C++ code and in which pass variable by reference. Here, integer variable x pass by…
Q: #include using namespace std; const int y = 1; int main () ( int static y - 2; int i = 3, j - 4, m…
A: The output along with the explanation is given below:
Q: int i,j; for(i=1;ii;--j) cout<<"-"; } **_* ** **. ***.
A: CODE WITH OUTPUT:-
Q: 3.21 LAB: Smallest number Write a program whose inputs are three integers, and whose output is the…
A: Here is your solution -
Q: int x; x=-2; do { x++; cout0); cout<<"done";
A: This is a while statement code
Q: Fill in the blanks
A: Explanation: The correct code after filling up all the blanks in the code is given below. In the…
Q: main(){ int M-20; if(M=340) cout<<M:} 20 O 40 O 21 O
A: Answer: Nothing will be printed last option i guess because its missing the first 3 options are…
Q: int pertambahan(int pilihan, int now){ int result; result =pilihan + now; return result; } int…
A: Given Program: #include <stdio.h> int pertambahan(int pilihan, int now){ int result; result…
Q: 37. #include <s nt main() { int num = 5; hui %3D printf(" The v
A: Explanation: In given we are trying to print the integer variable here "%d" refers to that we are…
Q: #include int main() { int y = 10000; int y - 34; printf("Hello world! %d\n", y);
A: Given, Code: #include <stdio.h> int main() { int y = 10000; int y = 34;…
Q: Specify the local and Global variables used in the code below and express the reason
A: Before giving answer to above question we need to know that: Those variables which are defined…
Q: #include using namespace std int main() { int x=6; int y=10; int 7-6:
A: Please find the answer below :
Q: the value
A: The value of the given program
Q: Explain the values of int data type.
A: Integer data type: The Integer data type is used to store numeric value for variables. The Integer…
Step by step
Solved in 3 steps with 2 images