Write a program to count the number of characters, number of
words, number of line in file.
Answers were Sorted based on User's Feedback
Answer / jayakrishnan
File.ReadAllLines("").Length;
File.ReadAllText("").Split(' ').Length - 1;
File.ReadAllText("").Length
| Is This Answer Correct ? | 5 Yes | 3 No |
Answer / ashutosh mishra
#include <stdio.h>
main()
{
int i,j,n,c=0,b;
printf("enter the number to be checked\n");
scanf("%d",&n);
j=n;
for(i=1;i<n;i++)
{
b=n%i;
if(b==0)
{
c=c+i;
}
}
if(c==j)
printf("the given number is perfect number\n");
else
printf("the given number is not a perfect number\n");
getch();
}
| Is This Answer Correct ? | 5 Yes | 11 No |
Automatically Hyperlink URLs and E-Mail Addresses in ASP.NET Pages with C#
I am developing a web application using google map api.I want to update the map inside the div control within update panel. I got other controls updated but map doesn't get updated.I do not not want to update map whenever unnecessary controls are fired at server side.How could it be achieved?
Create a class called Accounts which has data members like ACCOUNT no, Customer name, Account type, Transaction type (d/w), amount, balance D->Deposit W->Withdrawal If transaction type is deposit call the credit(int amount) and update balance in this method. If transaction type is withdraw call debit(int amt) and update balance. Pass the other information like Account no,name,Account Type through constructor. Call the show data method to display the values.
program for string reverse(eg:- i am boy -> boy am i)
8 Answers Black Pepper, Infosys, Mind Tree,
"c sharp" code for factorial using static variables
Write a program to count 3Letter, 4Letter and 5Letter words from a file and print the number of 3Letter, 4Letter and 5Letter words. Delimiter is space, tab, hifen. Also we should not consider the line in the file after we encounter # in that line.
how can i split sting in textbox in windows application using c# .net
Coding for Manipulate XML File Data Using C#?
Give the code for Handling Mouse Events?
how to get the table names via c sharp and column names also?
How to Create Files by Using the FileInfo Class?
How to pass multiple rows from one gridview to another gridview after clicking the checkbox.