sreejesh.k.r


{ City } kodungallur,trichur,
< Country > india
* Profession * fresher
User No # 60341
Total Questions Posted # 0
Total Answers Posted # 4

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 42
Users Marked my Answers as Wrong # 11
Questions / { sreejesh.k.r }
Questions Answers Category Views Company eMail




Answers / { sreejesh.k.r }

Question { 11307 }

A string of charaters were given. Find the highest
occurance of a character and display that character.
eg.: INPUT: AEGBCNAVNEETGUPTAEDAGPE
OUTPUT: E


Answer

#include
#include
void main()
{
int i,j,n;
char str[20];
int max[20],x=1,high;

clrscr();

printf("Enter the string");
scanf("%s",str);//assas[s]iation
n=strlen(str);
for(i=0;i max[i]=1;

for(i=0;i {
for(j=0;j if(strcmp(str[i],str[j])==0)
{
max[i]++;

if(max[i]>x)
{
x=max[i];
high=i;
}

}

}
printf("%c is occured %d times",str[high],x);

getch();
}




Is This Answer Correct ?    21 Yes 1 No

Question { Cipla, 3126 }

how to make a software for a game ?


Answer

Use adventure maker like softwares...

Is This Answer Correct ?    0 Yes 0 No


Question { TCS, 9201 }

Write a program that takes a 3 digit number n and finds out
whether
the number 2^n + 1 is prime, or if it is not prime find out its
factors.


Answer

//Sorry, this code is wrong
//but'll be useful for some other logic
#include
#include
void main()
{
int i,j,n,x,flag=0,d;
clrscr();
printf("\tPRIME CHECK\n");
printf("Enter a 3digit no:");
scanf("%d",&n);

if((n/100>0)&&(n/100<10))
printf("\nNumber is of 3 Digits");
else
printf("\nNot a 3 digit number");

for(j=2;j if(n-1==j)
{
printf("\n\t%d is a prime",n);

flag=1;

d=n-1;
while(d%2==0)
d=d/2;

if(d==1)
printf("\nNumber%d is in 2^n+1 format",n);
}

if(!flag)
{
printf("\nNumber %d is not a prime",n);
printf("\nIts factors are:\n\t");

x=2;
while(n!=1)
{
while(n%x==0)
{
n=n/x;
printf("%d ",x);
}
x++;
}
}
getch();
}

Is This Answer Correct ?    16 Yes 6 No

Question { TCS, 6182 }

c# coding for a program that takes a 3 digit number n and
finds out whether the number 2^n + 1 is prime, or if it is
not prime find out its factors not using the Big-integer
and Exponential Function's.


Answer

Me too want the code for this...

Is This Answer Correct ?    5 Yes 4 No