Question: present a menue to print author info , print values , clear data , sort data , inter integer , inter double , Exit by
#include
int n_i = 0, n_d = 0;
in int no_i[984];
double no_d[984];
void printValues();
int main()
{
int choice, I, j, temp;
do{
printf(1)Print author info 2)Print values 3)Clear data 4)Sort data 5)Enter integer 6)Enter double 7)Exit );
scanf(%d, &choice);
switch(choice)
{
case(1):
printf("Name: ___ ID:_____");
break;
case (2):
printValues ();
break;
case (3):
memset(no_i, 0, sizeof(no_i));
memset(no_d, 0, sizeof(no_d));
i=0;
d=0;
printf(" Data cleared ");
break;
case 4:
for (i = 0; i
{
for (j = 0; j
{
if (no_i[j] > no_i[j + 1])
{
temp = no_i[j];
no_i[j] = no_i[j + 1];
no_i[j + 1] = temp;
}
}
}
for (i = 0; i
{
for (j = 0; j
{
if (no_d[j] > no_d[j + 1])
{
temp_i = no_d[j];
no_d[j] = no_d[j + 1];
no_d[j + 1] = temp_i;
}
}
}
printValues ();
break;
case 5: /* Enter integer */
printf(" Enter integer : ");
scanf("%d", &no_i[n_i]);
n_i++;
break;
case 6: /* Enter double */
printf(" Enter double : ");
scanf("%lf", &no_d[n_d]);
n_d++;
break;
case 7:
break;
default: printf("wrong choice.Enter Again");
break;
}
} while(choice != 7);
}
void printValues () {
int i;
printf(" Integer Values :: ");
for(i=0; i
{
printf("%d ", no_i[i]);
}
printf(" Double Values :: ");
for(i=0; i
{
printf("%lf ", no_d[i]);
}
}
what does these means
temp , memset , and can we use some thing diffrent than no_i , no_d
because we dont use it in class
also about void print values we dont use it in class
Present a nenu with the following opttons 1) print author infe 2) print valuers ) Clear data 1) Sort data 5) Enter Integer 6) Enter double o) Extt Author info prints your nane .nd Clear data deletes all entered data Sort data sorts both the Integers and the double valurs Enter integer allows the user to enter an Integer value that wilt be stered Enter double allows the user te specify a deuble (or fleat if you choose) value te be stared print data prints out all stored data donot M. t. "sar" that they user dm-t-ow tie limt. Your progran needs to be able to support up to 984 values o, each type
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
