prev


Character Arrays:

74.Read until newine char (12.05.2010)

/*
Program# 74
date : 28-12-2008
Read a string until newline.
*/

#include <stdio.h>
main(){
char a[100];
int i;

i=0;
scanf("%c",&a[i]);
while(a[i]!='\n'){
i++;
scanf("%c",&a[i]);
}
a[i]='\0';
printf("\n%s",a);
}



next
blog comments powered by Disqus