pract4 - { int i, j; for (i=0; i<numRows; i++) {...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
int fa(int** pic1, int numRows, int numCols, int value1) { int i, j, count=0; for (i=0; i< numRows; i++) { for (j=0; j< numCols; j++) { if (pic1 [i][j]== value1) count++; } } return count; } _________________________________ void fb(int** pic1, int numRows, int numCols, int value1) { int i, j; for (i=0; i< numRows; i++) { for (j=0; j< numCols; j++) { if (pic1 [i][j] > value1) pic1 [i][j]=255; else pic1 [i][j]=0; } } } ____________________________________________ void fc(int** pic1, int numRows, int numCols, int value1) { int i, j; double temp; for (i=0; i<numRows; i++) { for (j=0; j<numCols; j++) { temp = pow(numRows/2-i,2)+pow(numCols/2-j,2); if(temp<=pow(value1,2)) pic1[i][j]+=200; } } } ____________________________________________________ void fd(int** pic1, int numRows, int numCols, int value1) { int i, j; for (i=0; i<numRows; i++) pic1[i][value1]=255;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
for (j=0; j<numCols; j++) pic1[value1][j]=255; } void fe(int** pic1, int numRows, int numCols, int value1)
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { int i, j; for (i=0; i&lt;numRows; i++) { pic1[i][i]=value1; pic1[numRows-1-i][i]=value1; } } ______________________________________________________ void f7 (int** pic1, int numRows, int numCols) { int i, j, x, y; int** imgtemp1; imgtemp1 = setImage(); for(i=0; i&lt;numRows; i++) { for (j=numCols/2; j&lt;numCols; j++) { pic1[numRows-i-1][j-numCols/2] = pic1[i][j]; } } } _________________________________________________________________ FILE *ifp, *ofp; int main() { int i, n, ssn; float wage, totalw=0; char fname[SIZE]; printf(&quot;Enter the name of the file u want to open: &quot;); scanf(&quot;%s&quot;, fname); ifp= fopen (fname, &quot;r&quot;); fscanf(ifp, &quot;%d&quot;, &amp;n); for (i=1; i&lt;=n; i++) { fscanf(ifp, &quot;%d %f&quot;, &amp;ssn, &amp;wage); totalw+=wage; } printf(&quot;. ..All data was read correctly. .. \n&quot;); printf(&quot;Enter the name of the new file: &quot;); scanf(&quot;%s&quot;, fname); ofp= fopen (fname, &quot;w&quot;); fprintf(ofp, &quot;%.2f&quot;, totalw/n); fclose(ifp); fclose(ofp);...
View Full Document

Page1 / 3

pract4 - { int i, j; for (i=0; i&amp;amp;lt;numRows; i++) {...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online