Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a complete and correct C program to prompt the user to enter two numbers a

ID: 3573604 • Letter: W

Question

Write a complete and correct C program to prompt the user to enter two numbers and display the sum and difference of the two numbers. To save space and time, do not include commends, but do include statements that tell users what to input and what is being output. Develop, implement, and debug a C programming solution using Microsoft Visual Studio.Net. You may write your code in Notepad or some other editor and copy it into VS. Net for compilation and testing. Before submitting your program, you may either submit the .cpp file produced by VS. net or copy the source program into Notepad and submit the .txt file. Attach your completed (or partially completed solution)as a file named answer9.cpp or answer9.txt. Select one of the following two programs to complete. To save time and space, do not include any comments, but do include reasonable interactive prompts and descriptions of any data displayed on a computer screen. Write a program to print the smallest number from among n numbers, where the number of numbers n is entered by the user. Also, prompt the user to enter each of the n numbers. OR Write a program that prompts the user to enter 15 integer numbers and write these numbers into a data file named test_scores.dat Develop, implement, and debug a C programming solution using Microsoft Visual Studio. Net. You may write your code in Notepad or some other editor and copy it into VS.Net for compilation and testing. Before submitting your program, you may either submit the .cpp file produced by VS.Net or copy the source program into Notepad and submit the .txt file Attach your completed (or partially completed solution) as a file named answer10.cpp or answer10.txt.

Explanation / Answer

//Answer for question 4.

#include <stdio.h>

int main()

{

int number1 , number2, sum , difference;

printf("Enter two numbers:");

scanf("%d %d ", &number1,&number2);

sum = number1 + number2;

difference = number1-number2;

printf(" The sum of the two entered numbers = %d",sum );

printf(" The difference of the two entered numbers = %d",difference );

return 0;

}

//Please copy the above program into notepad and save it as answer9.txt

//Question 5 first part can be solved by accpeting the numbers from the users and initially storing them into an array

#include <stdio.h>


int main()

{

int n , i, a[100], smallest=0;

printf("Enter the value of n:");

scanf("%d" , &n);

printf("Enter each value of n:");

for(i=0; i<n; i++)

{

scanf("%d", &a[i]);

}

smallest = a[0];

   for (i=1; i<n;i++)

   {

       if(a[i]< smallest)

   {

smallest = a[i];

   }
   }

printf(" Minimum element = %d",smallest);

return 0;

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote