Click here to Skip to main content
15,898,134 members
Home / Discussions / C#
   

C#

 
AnswerRe: i need to save me textbox data to separate line in notepad Pin
OriginalGriff18-May-18 23:59
mveOriginalGriff18-May-18 23:59 
AnswerRe: i need to save me textbox data to separate line in notepad Pin
Dave Kreskowiak20-May-18 5:33
mveDave Kreskowiak20-May-18 5:33 
QuestionMy code is not calculating correctly... I just need an extra pair of eyes to help me see what I am missing. Please help Pin
Member 1383451318-May-18 21:59
Member 1383451318-May-18 21:59 
AnswerRe: My code is not calculating correctly... I just need an extra pair of eyes to help me see what I am missing. Please help Pin
OriginalGriff18-May-18 22:00
mveOriginalGriff18-May-18 22:00 
AnswerRe: My code is not calculating correctly... I just need an extra pair of eyes to help me see what I am missing. Please help Pin
Richard MacCutchan18-May-18 23:45
mveRichard MacCutchan18-May-18 23:45 
AnswerRe: My code is not calculating correctly... I just need an extra pair of eyes to help me see what I am missing. Please help Pin
Implements Master Yoda21-May-18 4:34
Implements Master Yoda21-May-18 4:34 
QuestionQuestion in principal regarding writing an Outlook Plugin Pin
Jim60718-May-18 0:35
Jim60718-May-18 0:35 
AnswerRe: Question in principal regarding writing an Outlook Plugin Pin
Eddy Vluggen18-May-18 1:23
professionalEddy Vluggen18-May-18 1:23 
GeneralRe: Question in principal regarding writing an Outlook Plugin Pin
Jim60718-May-18 1:39
Jim60718-May-18 1:39 
GeneralRe: Question in principal regarding writing an Outlook Plugin Pin
Eddy Vluggen18-May-18 13:13
professionalEddy Vluggen18-May-18 13:13 
AnswerRe: Question in principal regarding writing an Outlook Plugin Pin
Gerry Schmitz18-May-18 8:14
mveGerry Schmitz18-May-18 8:14 
QuestionApp pool is crashing due to memory leakage Pin
Anoop Mehra17-May-18 18:22
Anoop Mehra17-May-18 18:22 
GeneralRe: App pool is crashing due to memory leakage Pin
Randor 17-May-18 18:45
professional Randor 17-May-18 18:45 
AnswerRe: App pool is crashing due to memory leakage Pin
OriginalGriff17-May-18 20:04
mveOriginalGriff17-May-18 20:04 
GeneralRe: App pool is crashing due to memory leakage Pin
Anoop Mehra17-May-18 22:59
Anoop Mehra17-May-18 22:59 
GeneralRe: App pool is crashing due to memory leakage Pin
OriginalGriff17-May-18 23:26
mveOriginalGriff17-May-18 23:26 
Questionc# array Pin
swathiii15-May-18 21:00
swathiii15-May-18 21:00 
SuggestionRe: c# array Pin
Richard MacCutchan15-May-18 21:30
mveRichard MacCutchan15-May-18 21:30 
AnswerRe: c# array Pin
OriginalGriff15-May-18 21:34
mveOriginalGriff15-May-18 21:34 
GeneralRe: c# array Pin
swathiii15-May-18 21:50
swathiii15-May-18 21:50 
this is the code which i tried.it is actually giving output for first frequent element but producing a false output for second frequent.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp14
{
class Program
{
static void Main(string[] args)
{
int i, j, count, maxcount = 0, number = 0, n = 10, part1 = 0, part2 = 0, number1 = 0;
int[] array = new int[10];
for(int k=0;k<10;k++)
{
array[k]= Convert.ToInt32(Console.ReadLine());
}

for (i = 0; i < n; i++)
{
count = 0;
for (j = 0; j < n; j++)
{
if (array[i] == array[j])
count++;
}
if (count > maxcount)
{
maxcount = count;
number = array[i];
}
else
if (count == maxcount)
{
if (array[i] > number)
number = array[i];
}
}
maxcount = 0;

for (i = 0; i < n; i++)
{
count = 0;
if(array[i]==number)
{
continue;
}
for (j = 0; j < n; j++)
{
if (array[i] == array[j])
count++;
}
if (count > maxcount)
{
maxcount = count;
number1 = array[i];
}
else
if (count == maxcount)
{
if (array[i] > number)
number1 = array[i];
}
}
part1 = number;

part2 = number1;
Console.WriteLine(part1);
Console.WriteLine(part2);
Console.ReadKey();

}
}
}

GeneralRe: c# array Pin
OriginalGriff15-May-18 21:58
mveOriginalGriff15-May-18 21:58 
GeneralRe: c# array Pin
Mycroft Holmes15-May-18 23:16
professionalMycroft Holmes15-May-18 23:16 
GeneralRe: c# array Pin
OriginalGriff15-May-18 23:38
mveOriginalGriff15-May-18 23:38 
GeneralRe: c# array Pin
Pete O'Hanlon16-May-18 0:56
mvePete O'Hanlon16-May-18 0:56 
GeneralRe: c# array Pin
OriginalGriff16-May-18 1:14
mveOriginalGriff16-May-18 1:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.