C programming 2012

Year 2012 Q.No 3 a) #include<stdio.h> #include<stdlib.h> int main() { float *p; int n,i; float g; printf(“How many float number you want to enter? “); scanf(“%d”,&n); p=(float*)malloc(n*sizeof(float)); printf(“Enter %d float numbers “,n); for(i=0;i<n;i++) scanf(“%f”,&p[i]); for(i=0;i<n-1;i++) { if(p[i]>p[i+1]) { g=p[i]; } else { g=p[i+1]; } } printf(“greatest number is %f”,g); return 0; } b) #include<stdio.h> #include<stdlib.h> […]

Continue Reading