Concept explainers
Show the printout of the following code:
Want to see the full answer?
Check out a sample textbook solutionChapter 4 Solutions
Introduction to Programming with C++
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Objects (6th Edition)
Starting out with Visual C# (4th Edition)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Starting Out with C++: Early Objects
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Computer Systems: A Programmer's Perspective (3rd Edition)
- I assume the following 2 codes express the same meaning? int myvar; int * myptr = &myvar; and int myvar; int * myptr; myptr = &myvar;arrow_forwardNumber of digits int main() {int c=0;int i=3856; int l=i; while(l>0) {l=l/10; c++; } printf("%d",c); return 0; } Summation of digits int main() {int sum=0; int i=384; int l=i; while(l>0) { sum+=l%10; l=l/10;} printf("%d",sum); return 0; }arrow_forwardQ 6:- Specify the local and Global variables used in the code below and express the reason r'. #include int a=10,b; void main() { printf("a = 8d and b=%d“,a,b) ; #include void main() { int x-23, y-4; printf("x = %d and y=sd“,x,y);arrow_forward
- be recor #include #include minutes #include limit on int func(int, int, int, int); main(){ srand(time(NULL)); int a, b, c, fNum; printf("Choose three different numbers between 0-39:"); scanf ("%d%d%d", &a, &b, &c); fNum = func (a, b, c, 25); printf("\nThe result: %d", fNum); } int func (int ul, int u2, int u3, int iter){ srand (time (NULL)); int n1=0, i=0, count=0; for (;iarrow_forward1) Find the errors in the following codes: int main() { } int { Hanging Indent #include ; int a = 1;b = 4; c, d C + = a++; d = 5--; printf("Please enter an inter: "); scanf("%f", num) d = (num = 0? a+b:a+b+c); sum= (a:b:c:d: a+b+c+d); printf("Sum is %d: \n", Sum); Return 0;arrow_forwarda) Given the following codes int x = 0; int *y = while(x < 10) { int z = 0; 1: 2: 3: 4: 5: 6: 7: malloc(sizeof(int)); int y = x; while (y } < 10) { z = z + y; y = y + 1; 8: 9: 10: } 11: *y = x; Write the symbol table indicating the type of variables in line 4arrow_forwardUse C language in creating this programarrow_forwardVoid Do1 (int: &, a. int &b) { a = 5; a = a + b; b = a + 2; } Int main() { Int x = 10; Do1 (x,x); Cout << x << endl; } The output of this program isarrow_forwardvoid funOne(int a, int& b, char v); void main() { int num1=10; char ch='A'; funOne(num1, 15,ch)<arrow_forward13. Given the code char* myFunc (char *ptr, int n) { ptr += n; return ptr; } int main() { char x[100] = Code1; char *y. int n = Code2; y = myFunc (x, n); printf ("%s\n", y); return 0; } where Code1 and Code2 are not given. Which of the following does not give the output ABCDEF Code1 is "XYZABCDEF" and Code2 is 3 Code1 is "ABCABCDEF" and Code2 is 3 Code1 is "ABCDEFXY" and Code2 is 6 Code1 is "ABCDEF" and Code2 is 0arrow_forwardDETERMINE THE OUTPUT OF THE CODE: #include using namespace std; int main() { int i; for (i = 1; i using namespace std; int main() { int i; for (i = 0; i > 10; i++){ {cout <« i «" "; } } return 0; 123456789 123456789 10 no output 0123456789arrow_forwardJAVA Programming Problem 2 - Diving In the sport of diving, seven judges award a score between 0 and 10, where each score may be a floating-point value. The highest and lowest scores are thrown out and the remaining scores are added together. The sum is then multiplied by the degree of difficulty for that dive. The degree of difficulty ranges from 1.2 to 3.8 points. The total is then multiplied by 0.6 to determine the diver’s score. Write a computer program that will ultimately determine the diver’s score. This program must include the following methods: A method name inputValidScore that inputs one valid score for one judge for one diver. This method will return the valid score. A method named inputAllScores that creates an array to store the scores for all judges for the diver. This method will fill the array with a valid score from each judge. This method does not take input arguments, but it does return the array of scores. A method named inputValidDegreeOfDifficulty that inputs a…arrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_iosRecommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning