TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Chandan Sharma
NA
12
3.6k
Program for shorting is not working
Nov 29 2018 9:12 AM
#include<stdio.h>
#include<conio.h>
void main()
{
int arr1[5]={2,1,4,3,5},arr2[5]={6,7,9,5,8},arr3[10],i,j,temp,k=0;
clrscr();
for(i=0;i<10;i++)
{
if(i>4)
{
arr3[i]=arr2[k];
k++;
}
else
arr3[i]=arr1[i];
}
printf("elements are \n ");
for(i=0;i<10;i++)
{
printf("\n %d",arr3[i]);
}
for(i=0;i<9;i++)
{
for(j=j+1;j<10;j++)
{
if(arr3[j] >arr3[i])
{
temp=arr3[i];
arr3[i]=arr3[j];
arr3[j]=temp;
}
}
printf("\n shorted elements are \n");
for(i=0;i<10;i++)
{
printf("\t %d",arr3[i]);
}
getch();
}
}
Reply
Answers (
1
)
How to use list values to update table column in a database?
How to convert array of int & bools from javascript to C#