code for selection sort?
Answer / 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 |
code for copying two strings with out strcpy() function.
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
Is an array parameter is always "by reference" ?
what type of questions arrive in interview over c programming?
how many times does the loop iterated ? for (i=0;i=10;i+=2) printf("Hi\n");
where does malloc() function get the memory?
Explain Basic concepts of C language?
What are the loops in c?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
#include<stdio.h> void main() { int a [5]; for (i=0; i<=4; i++) printf(ā%dā ,a[i]); }
State two uses of pointers in C?
Explain the use of function toupper() with and example code?