Documentation & Naming Style Sheet 1. Opening Documentation: the header block sh
ID: 3631460 • Letter: D
Question
Documentation & Naming Style Sheet1. Opening Documentation: the header block should include the following:
•Program name/syntax
•Description of what the program does
•Summary of the problem's specifications and assumptions
•License info (optional)
•References to sources of additional information used
•Parameters
•Class/Program Invariant (ensure these conditions are true)
•Algorithm(s) used (including any special notes)
•Output (any print statements, files created, etc.)
•Return values (does it return any parameters?)
•Name of the authors (plus contact info)
•Creation & modification dates
•Write a program to display the duplicate values in an array.
Explanation / Answer
please rate - thanks
#include <stdio.h>
#include <conio.h>
int main()
{int a[10]={1,2,3,4,5,6,6,7,2,3};
int found[10],count=0;
int n=10,i,j,k=0;
printf("The array: ");
for(i=0;i<n;i++)
printf("%d ",a[i]);
printf(" ");
printf("Numbers that appear more than 1 time: ");
for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)
if(a[i]==a[j])
{for(k=0;k<count;k++)
if(a[i]==found[k])
k=50;
if(k!=50)
{found[k]=a[i];
count++;
}
}
for(i=0;i<count;i++)
printf("%d ",found[i]);
printf(" ");
getch();
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.