please write c programming for this code below.
The code:
#include <stdio.h>
int main(void) {
// your code goes here
int row; //to take input as number of row
int x,y,z,m; //to iterate loops
//take input now
printf("Enter the number of rows: ");
scanf("%d", &row);
//print the pattern
for(x=1;x<=row;x++) //outer loop for this number of
lines
{
for(y=1;y<=row-x;y++) //to print spaces before the number
{
printf(" ");
}
for(z=1;z<=x;z++) // to print the number for pattern
{
printf("%d",z);
}
for(m=x-1;m>=1;m--) // print the remaining number
{
printf("%d",m);
}
printf("\n"); //new line
}
return 0;
}
Running code screenshot with output:

Code is well commented.
Hope this helps!
Kindly appreciate the help by upvoting the answer. Thank you!
please write c programming for this code below. Write a program to print a pattern of...
Write a program to read two integer values and print true if both the numbers end with the same digit, otherwise print false. Example: If 698 and 768 are given, program should print true as they both end with 8. [Hint: The % operator can be used to find the remainder.] At the time of execution, the program should print the message on the console as: Enter two integer values : For example, if the user gives the input as...
Please complete this code for java
Lab Write a program as follows: Create an array with 10 elements. The array should contain numbers generated randomly between 1 and 100 Ask the user to enter any number - Search the array to see if the user entered number is in the array If the user-entered number is in the array, print a 'match found' message. Also print at which index the match was found, else print a 'match not found' message...
Java Programming. Write your own source code with comments.
(Print distinct numbers) Write a program that reads in ten
numbers and displays the number of distinct numbers and the
distinct numbers separated by exactly one space (i.e., if a number
appears multiple times, it is displayed only once). (Hint: Read a
number and store it to an array if it is new. If the number is
already in the array, ignore it.) After the input, the array
contains the distinct...
C Programming For this task, you will have to write a program that will prompt the user for a number N. Then, you will have to prompt the user for N numbers, and print then print the sum of the numbers. For this task, you have to create and use a function with the following signature: int sum(int* arr, int n); Your code should look something like this (you can start with this as a template: int sum(int* arr, int...
In C programming language have a program request the user to
enter an uppercase letter. Use nested loops to produce a pyramid
pattern like this:
The pattern should extend to the character entered. For example,
the preceding pattern would result from an input value of E. Hint:
Use an outer loop to handle the rows. Use three inner loops in a
row, one to handle the spaces, one for printing letters in
ascending order, and one for printing letters in...
The answer need to write in C programming.
QUESTION 2 Write a program using array to generate a multiplication table based on the user's input. For example if user enter 5 as input then a multiply table for 1 to 5 is printed as output as shown in Figure Q2. There are three main steps in this program which are: Print rows (a) (b) Print columns Print multiplication of data inside table (c) Select C:\example1 \bin\Debuglexample 1.exe enter the value...
Python Programming
Q.3) Write a program that repeatedly asks the user to enter words until they enter a period ("."). Your program should then print all of the words they entered including the period) on a single line separated by spaces. For example, Enter some words (. to stop): > hello > world hello world.
please solve using python
thank you!
Write a program which prompts the user to enter a number of rows, and prints a hollow square star pattern with 2 diagonals. Note: you can assume that the integer will always be > 1 and will be an odd number. For example: Input Result 5 Enter number of rows: 5 ***** ** ** * * * ** ** ***** 9 Enter number of rows: 9 ** ** ** * * * * *...
write in c programming
Write a C program that reads in up to 10 numbers into an array. The program should count the number of duplicate elements within that array and print the result. Example test data and expected output is given below Test Data: [2,1,1,2,1,3, 4] Duplicates:
Write the Code in C program. Create a random password generator that contains a user-specified number of characters. Your program should prompt the user for the desired length of the password. Length of password: To create your password, use the random number generator in the stdlib.h C library. To generate random numbers, you will need the srand() and rand() functions. srand(seed) is used to "seed" the random number generator with the given integer, seed. Prompt the user for the seed...