Lab Program
Lab Program
Lab Program
sNo=34&qId=5b9e68c018b23e0ba62a5e4e&bd=AY3RFZHVEQg%3D%3D&lid=5d…
Exp. Name: Write a C program to Count the Lines, Words and Characters in a given
S.No: 34 Date:
text
Page No:
Aim:
Write a C program to count the lines, words and characters in a given text.
ID: 19091A04P2
At the time of execution, the program should print the following message on the console as:
Note: Do use the printf() function with a newline character ( \n ) at the end.
Source Code:
CountLinesWords.c
#include<stdio.h>
#include<string.h>
void main()
{
char str[70];
int Character=0,Words=0,Lines=0,i;
Test Case - 1
User Output
https://rgmcet.codetantra.com/secure/labs-q.jsp?sNo=34&qId=5b9e68c018b23e0ba62a5e4e&bd=AY3RFZHVEQg%3D%3D&lid=5d7fba0de9d70… 1/2
12/9/2019 https://rgmcet.codetantra.com/secure/labs-q.jsp?sNo=34&qId=5b9e68c018b23e0ba62a5e4e&bd=AY3RFZHVEQg%3D%3D&lid=5d…
Test Case - 1
Enter lines of text (enter END to complete) CodeTantra developed a Robotic tool
in the year 2016 in the
Page No:
year
2016
and they released in 2017 and
ID: 19091A04P2
they
released
in 2017
END END
Character = 76, Words = 14, Lines = 3
https://rgmcet.codetantra.com/secure/labs-q.jsp?sNo=34&qId=5b9e68c018b23e0ba62a5e4e&bd=AY3RFZHVEQg%3D%3D&lid=5d7fba0de9d70… 2/2