14 Reputation Points
Ranked #2K
- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
100% Quality Score
- Upvotes Received
- 2
- Posts with Upvotes
- 1
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
0 Endorsements
Ranked #72.9K
~523 People Reached
This member's community profile is only visible to logged in members until they have earned 15 reputation points.
Favorite Forums
2 Posted Topics
Re: Array
void main() { int i,j,swap=1; int arre[5],prod[5]; clrscr(); printf("nter values in the array "); for(i=0;i<5;i++) scanf("%d",&arre[i]); for(j=0;j<5;j++) { for(i=0;i<5;i++) { if(i==j) continue; else swap=swap*arre[i]; } prod[j]=swap; swap=1; } printf("The output is "); for(j=0;j<5;j++) printf("%d",prod[j]); getch(); }
I will show you how to swap numbers. void main() { int x, y; clrscr(); printf("Enter two positive numbers"); scanf("%d%d",&x,&y); y=y+x; x=y-x; y=y-x; printf("The swapped numbers are %d and %d",x,y); getch(); /* Comments: Let x=3 and y=4; so y=x+y will give y= 3+4 y=7 x=3 x=y-x will give x = …
The End.