prev


Character Arrays - String manipulations:

92.Position after each line (14.05.2010)

/*
Program# 92
date : 10-01-2009
Position after each line
*/

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

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

i=0;
while(a[i]!='\0'){
if(a[i]=='\n'){
printf("\n Starting Position =%d",i+1);
}
i++;
}
}



next
blog comments powered by Disqus