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 |
Coding for Manipulate XML File Data Using C#?
Write a function which accepts list of nouns as input parameter and return the same list in the plural form. Conditions: i) if last letter is r then append s ii) if word ends with y then replace it by ies iii) call this function in main() and produce the required output. for eg:- if chair is input it should give chairs as output.
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.
Can you declare an array of mixed Types?
Code for Reading and writing from a file in c#?
Write a program to convert postfix expression to infix expression.
How to add a value from textBox over an existing certain column in SQL Server
How to find No of classes,Packages,No of Methods per Classes and Depth of Inheritance for selecting source code in windows form application using c# .net? (Source code is input Program. It may be Java or .net) Please help me..) Thanks..)
program for straight line(y=mx+c)
program for addition of fraction(M/N + P/Q = Y/Z)
Hello Sir, Thanks for the Solution but, can you pls. Explain the coding for the Static Function & static variable from the below coding....waiting for Ans. class fact { public static void Main() { fact f=new fact(); int x=1; //Declaration of x as 1 int k=Convert.ToInt32(Console.ReadLine()); for(int i=1;i<=k;i++) { x= x *i; } System.Console.WriteLine(x); } }
how to get the table names via c sharp and column names also?