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 |
how can i split sting in textbox in windows application using c# .net
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.
Give the code for Handling Mouse Events?
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.
write a Program to copy the string using switch case.
working with arrays
Code for IP Address Comparison and Conversion in C#?
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..)
c# code to Count number of 1's in a given range of integer (0 to n)
How to Create Files by Using the FileInfo Class?
Write a program to input an integer and - display the reverse - display the sum of each digit - should include logic that considers the input number as any number of digits long
Write a program which has a function and that function should take 2 or 3 or any number of strings and it should return the largest common prefix of all those strings. If there is no common prefix it should return an empty string. for eg:- INPUT OUTPUT glo {glory,glorious,glod} gl {glad,glow} {calendar,phone} empty string