Question

Write a program that asks the user to input 10 int
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<stdio.h>
void main()
{
   int a[10],i,ele,pos;
   printf("Enter a list of 10 intrgers :");
       for(i=0;i<10;i++)       //reading array
   scanf("%d",&a[i]);
   printf("Enter the value to insert :");
   scanf("%d",&ele);
   printf("Enter the position to place the value <between 0 and 9>");
   scanf("%d",&pos);
   for(i=9;i>pos;i--)   //replacing the values from given position to end
       a[i]=a[i-1];
   a[pos]=ele;
   printf("the new values of the array are :");
   for(i=0;i<10;i++)       //printing new array
       printf("%d ",a[i]);
}

output;

C:Documents and SettingsAdministrator Desktoplskip.exe Enter a list of 10 intrgeFs 5 12 36 1 20 9 23 8 22 nter the value to i

Add a comment
Answer #2

Fuck You Mother Fuckers

source: muth
answered by: anonymous
Add a comment
Know the answer?
Add Answer to:
Write a program that asks the user to input 10 integers of an array. The program...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • (C programing, Not C++) Write a program in C that asks the user to input 10...

    (C programing, Not C++) Write a program in C that asks the user to input 10 numbers. Store these numbers in an array. Then ask the user to input a single number. Your program should execute a linear search on the array, trying to find that number. If the number exists in the array, have the program print out which position/element the number was found at. If the target number is not in the array, have the program print out...

  • For Java - Write a program that creates an array of 10 integers. Ask the user...

    For Java - Write a program that creates an array of 10 integers. Ask the user to enter the subscript (index) of an element, then displays the element located at that subscript. If the subscript entered is out of bounds (less than 0 or greater than length - 1), display the message "Out of Bounds".

  • Write a C++ function, smallestIndex, that takes as parameters an int array and its size and...

    Write a C++ function, smallestIndex, that takes as parameters an int array and its size and returns the index of the first occurrence of the smallest element in the array. To test your function, write a main that prompts a user for a list of 15 integers and outputs the index and value of the first occurrence of the smallest value. The program should print out Enter 15 integers: The position of the first occurrence of the smallest element in...

  • Write a program that asks the user to input 5 integers in an Array named "gradearray.”...

    Write a program that asks the user to input 5 integers in an Array named "gradearray.” then passes gradearray in a function to find how many passing grades exist. (passing grades are between 60 and 100) Input elements for the gradearray : 67 43 90 100 75 There are 4 passing grades There are 1 failing grades

  • Write a C Program that inputs an array of integers from the user along-with the length...

    Write a C Program that inputs an array of integers from the user along-with the length of array. The program then prints out the array of integers in reverse. (You do not need to change (re-assign) the elements in the array, only print the array in reverse.) The program uses a function call with array passed as call by reference. Part of the Program has been given here. You need to complete the Program by writing the function. #include<stdio.h> void...

  • Write a program that asks the user to enter 1000 integers to be stored in an...

    Write a program that asks the user to enter 1000 integers to be stored in an array called "numbers". Since the same integer might occur (exist) in the array multiple times, your program needs to fill a second array, called "Isolate" that contains all the integers from the first array but NOT REPAPTED (every integer will exist only once). Finally, your program will print the integers of the second array sorted by occurrence (occurrence is: the number of times the...

  • Make a program using Java that asks the user to input an integer "size". That integer...

    Make a program using Java that asks the user to input an integer "size". That integer makes and prints out an evenly spaced, size by size 2D array (ex: 7 should make an index of 0-6 for col and rows). The array must be filled with random positive integers less than 100. Then, using recursion, find a "peak" and print out its number and location. (A peak is basically a number that is bigger than all of its "neighbors" (above,...

  • In JAVA write a program that contains an array containing 10 integers (1 to 10). user...

    In JAVA write a program that contains an array containing 10 integers (1 to 10). user insert an integer from (1 to 10) , method is library sort or gapped insertion sort that will each sort the array and print it out to the console.

  • Write an assembler program that asks the user (as shown below) for two integers and a...

    Write an assembler program that asks the user (as shown below) for two integers and a single character representing the arithmetic operations: addition, subtraction, multiplication and integer division (displays both quotient and remainder). Perform the requested operation on the operands and display the result as specified below. Assume SIGNED NUMBERS. The program should not divide by 0! If the user attempts to divide by 0, display the error message: "Cannot divide by zero." If this error occurs, the program should...

  • MIPS CODE required to write an assembly program to find the maximum of an array of integers by...

    required to write an assembly program to find the maximum of anarray of integers by doing the following:1. Prompt user to input array size n (n <= 10)2. Prompt user to input element values of array A one by one3. Display the result on the console.This program must at least include one function. The main program will read the valuesof the array (as user inputs the element values) and stores them in the memory (datasegments section) and at the end...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT