array using pointers

Run Settings
LanguageC
Language Version
Run Command
#include<stdio.h> #include<stdlib.h> int main() { int n,i; printf("entr n="); scanf("%d",&n); int *p=(int*)malloc(n*sizeof(int)); for(i=0;i<n;i++) { scanf("%d",p+i); } int l=*p; for(i=1;i<n;i++) {if (*(p+i)>l) l=*(p+i); } printf("largest= %d",l); }
Editor Settings
Theme
Key bindings
Full width
Lines