I have to code this: I ask for input from user and output should indicate how mant times user made that input:
some code:
Code:
#include <stdio.h>#include <stdlib.h>
int main()
{
int size, i, sum = 0, *number;
printf("How many numbers you want to input?");
scanf("%d", &size);
number = malloc(size * sizeof(int));
for (i = 0; i < size; ++i)
{
printf("\nEnter number %d:", i + 1);
scanf("%d", &number[i]);
printf("");
}
puts("\nBelow are the entered numbers");
for(i = 0; i < size; ++i)
{
printf("%d\t", number[i]);
}
//still thinking for code that would do this
// example: user input 1,2,3,3
// output 1 is seen 1 time/s.
// output 2 is seen 2 time/s.
// output 3 is seen 2 time/s.
free(number);
return 0;
}