Using High Assembly language Write a program to produce a number table as described here. This table should be built from a single integer value provided by the user. The program will display a square 5X5 of various numbers. The entered number should appear in an X like pattern across the table, diagonally across the table. Every other spot besides the X pattern should be filled with a number. Those excess numbers should start with one bigger than the entered number and increment by one for every additional excess number used.
For example, the following output should be produced when the user inputs the starting value 15:
Gimme a starting value: 15 15 16 17 18 15 19 15 20 15 21 22 23 15 24 25 26 15 27 15 28 15 29 30 31 15
Below C++(High Assembly Language) program will produce the required pattern.
Program starts;
#include<iostream>
#define GRID_SIZE 5
using namespace std;
int main(){
int x,current_value,i,j;
cout<<"gimme a number: ";
cin>>x;
cout<<endl;
//Upper half Grid
for(int i=0 ; i<GRID_SIZE/2 ; i++){
current_value = x + i*(GRID_SIZE-2) + 1;
for(j=0 ; j<i ; j++){
cout<<current_value++<<" ";
}
cout<<x<<" ";
for(j=i+1 ; j<GRID_SIZE-1-i ; j++){
cout<<current_value++<<" ";
}
cout<<x<<" ";
for(j=GRID_SIZE-i ; j<GRID_SIZE ; j++){
cout<<current_value++<<" ";
}
cout<<endl;
}
//Lower half Grid
for(int i=GRID_SIZE/2 ; i<GRID_SIZE ; i++){
current_value = x + i*(GRID_SIZE-2) + 1;
for(j=0 ; j<GRID_SIZE-i-1 ; j++){
cout<<current_value++<<" ";
}
cout<<x<<" ";
for(j=GRID_SIZE-i ; j<i ; j++){
cout<<current_value++<<" ";
}
if(GRID_SIZE%2==0 || i!=GRID_SIZE/2) {
cout<<x<<" ";
}
for(j=i+1 ; j<GRID_SIZE ; j++){
cout<<current_value++<<" ";
}
cout<<endl;
}
return 4;
}
Here is the Screenshot of output of the above program.
Here is the Screenshot of code.
Using High Assembly language Write a program to produce a number table as described here. This...
Linear Search: Write a MIPS assembly language program that can search for a number that entered by user in an array with 20 integer numbers and prints the index of the number in the array if it is found and -1 if not found
MIPS Assembly Language * Write a simple program to count the number of non overlapping repetitions of a character pattern in a character string. For example " the pattern "aa" appears twice in the in the string "aabbaaa". Provide a user interface to read the character pattern and the string.
Q-1: Write a program in Assembly language using MIPS instruction set that reads 15 integer numbers from user and stores all the numbers in the array intArray. Now, read another integer number N from the user, find the total number of array elements that are greater or equal to the number N, and the total number of array elements that are lower than the number N You must have two procedures: i. ReadIntegerArray: this procedure should read integer array elements...
the coding language is just the basic c language
and here is my first attempt at this problem
my problem is that if the user inputs a number that is equal
to a number that has been entered previously the code will never
end until the user enters a number that is bigger than any other
number previously entered
any help will be helpful
Write a program to read-in a sequence of integers from the keyboard using scanf(). Your program...
Write a simple program in arm, assembly language , using only
Registers, to test if 371 is an Armstrong number. The program
written should only have instruction set from the Cortex m0+. And
then put a 1 in a register to show it
It is, or 0 if it isn’t.
The second program is about the Armstrong numbers. You assume it will be a 3-digit number which will be entered through the data area. You can use a register so...
using assembly language in microwoft visual studio write the following code with procedure with correct number of Fib numbers Your program should detect the largest Fib number that can be calculated. Besides storing the result in an array, print them on the screen.
Write a simple and short MIPS assembly language program that asks the user for 6 numbers, merge-sorts them, and then prints them out in ascending order comment each and every programme .(USING WINDOWS QtSpim) Note : This question is not giving desired solution may you please try it in a simple manner for six number inputed by the user.
Write a program in MIPs Assembly Language to compute nth number of a fibonacci number sequence. Your program should prompt for an integer input n from the user. The program should call a recursive function to compute the nth fibonacci number. Your program must follow programming convention. You should submit program and screenshot of output in a single word/pdf file. You should use following recursive definition of fibonacci function: fib(0) = 0 fib(1) = 1 fib(n) = fib(n-1) +fib(n-2)
This assignment should be relatively easy. Write a program in any reasonably high-level language, that reads in numbers from a file, one per line, until it detects that a 0 (zero not an oh') has been entered The 0 does not count as part of the number series. After all numbers have been entered print out the number of items entered, the sum, the minimum value entered, the maximum value entered, and the arithmetic mean (one on each line), in...
Write a C++ program using "for" loop to allow user to guess a certain number say 55. The loop will end after 5 guesses or if he guesses the right number, which ever comes first. If user enters a number greater than 55, your program should print "You entered a bigger number". If user enters a number smaller than 55, your program should print "You entered a smaller number". If user enters 55 in less than 5 attempt, your program...