Quantcast
Viewing all articles
Browse latest Browse all 39796

getchar vs scanf

can any one tell me the difference b/w

int a[n];
for(int i=0;i<n;i++)<br> {
a[i]=getchar()-48;
}

and

int a[n];
for(int i=0;i< n;i++)
{
scanf("%1d",&a[i]);
}


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>