Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
/* Write a C Program to Accept an Array Of

/* Write a C Program to Accept an Array Of

Ratings: (0)|Views: 18 |Likes:
Published by sangitsme

More info:

Published by: sangitsme on Sep 23, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

07/13/2010

pdf

text

original

 
/* Write a C program to accept an array of 10 elements and swap 3rd ** element with 4th element using pointers. And display the results */#include <stdio.h>void main(){float x[10];int i,n;void swap34(float *ptr1, float *ptr2 ); /* Function Declaration */printf("How many Elements...\n");scanf("%d", &n);printf("Enter Elements one by one\n");for(i=0;i<n;i++){scanf("%f",x+i);}swap34(x+2, x+3); /* Function call:Interchanging 3rd element by 4th */printf("\nResultant Array...\n");for(i=0;i<n;i++){printf("X[%d] = %f\n",i,x[i]);}} /* End of main() *//* Function to swap the 3rd element with the 4th element in the array */void swap34(float *ptr1, float *ptr2 ) /* Function Definition */{float temp;temp = *ptr1;*ptr1 = *ptr2;*ptr2 = temp;} /* End of Function *//*-------------------------------------------OutputHow many Elements...10Enter Elements one by one102030405060708090

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->