Answer Posted / naveen shukla
#include<stdio.h>
#include<stdlib.h>
int main(){
int n,i,t;
printf("Enter the size of the array");
scanf("%d",&n);
int *p=(int *)malloc(sizeof(int)*n);
for(i=0;i<n;i++){
printf("Enter the %d" i+1 "number in the array");
scanf("%d;t);
*(p+i)=t;
}
for(j=0;j<n-1;j++){
int pos=j;
int k=j+1;
int min=*(p+j);
while(k<n){
if(a[k]<min){
m=p[k];
pos=k;
}
k++;
}
int temp=p[pos];
p[pos]=a[j];
a[j]=temp;
}
return 0;
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
How can a number be converted to a string?
What is a built-in function in C?
write a program to find the given number is prime or not
Who invented bcpl language?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
What does static variable mean in c?
What is #include conio h?
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
Can a pointer be null?
What are the header files used in c language?
Is there anything like an ifdef for typedefs?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
If I have a char * variable pointing to the name of a function ..
What does 4d mean in c?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?