Write a C- Program To Count The Lines, Words, Characters In A Given Text.
#include <conio.h> #include <stdio.h> main() { char text[200]; int i,l,ch,w,sp; clrscr(); i=0; printf("\n Enter lines of text and press ^Z"); while((text[i]=getchar())!=EOF) { i++; } printf("\n The number of characters is %d",i); text[i]='\0'; l=0; ch=w=sp=0; for(i=0;text[i]!='\0';i++) { ch++; if(text[i]==32 && text[i+1] != ' ') { w++; sp++; } if(text[i] == '\n') { l++; w++; } } printf("\n Total size of the text : %d",ch); printf("\n Number of Words : %d",w+1); printf("\n Number of Lines : %d",l); printf("\n Number of Spaces : %d",sp); getch(); }
What is an unrolled linked list?
Implement Bubble Sort using C.
What are Halstead’s metrics?
Write a C program to print pattern below:
*
* *
* * *
* * * *