Please help me, this assignment is due tomorrow. This program has to be written
ID: 3589972 • Letter: P
Question
Please help me, this assignment is due tomorrow. This program has to be written in C and not allowed to use anything beside %d, %c, if-else, while, if. It is highly prohibited using %f in printf() statement.
Objective: 1. get familiar with the process of completing a programming project in UNIX 2. declare and use of variables of basic types: int, char, float, and array 3. learn the basic human-computer interface with standard IO (printf, scanf) 4. use basic if and if-else statements for program selection 5. use while loop for program repetition 6. practice on designing and implementing algorithm/strategy to solve problems Description: In this project, you will design and implement a program that prints out numbers, both integers and floating point (real numbers), in a variety of formats, using only the basic sd and &c; format specifiers. Using other format specifiers (such as %nd. %) will result in a loss of points. The program will prompt the user to choose from a menu of options and from there your program will interact with the user to get input number and print it out in the required format.Explanation / Answer
C code:
#include <stdio.h>
int main()
{
int nOBj,iOBj,arrOBj[20];
printf(" Please mentioned the total numbers : ");
scanf("%d",nOBj);
printf(" Enter the number values: ");
for(iOBj=0;iOBj<nOBj;iOBj++)
{
scanf("%d", &arrOBj[iOBj]);
}
for (iOBj = 0; iOBj < nOBj; iOBj++)
{
printf(" arr[%d] = %d", iOBj, arrOBj[iOBj]);
}
return 0;
}
Output:
Please mentioned the total number
3
Enter the number values
3.45 56.3 4.6
3.45
56.3
4.6
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.