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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started