- Strength to Increase Rep
- +4
- Strength to Decrease Rep
- -1
- Upvotes Received
- 4
- Posts with Upvotes
- 4
- Upvoting Members
- 3
- Downvotes Received
- 15
- Posts with Downvotes
- 7
- Downvoting Members
- 13
45 Posted Topics
the formula for naive bayes is P(A/B1,B2,B3...Bn) = [ P(A) * P(B1/A) * P(B2/A) * . . . P(Bn/A) ] / [ P(B1) * P(B2) *....P(Bn) ] i am working on a project to classify email as spam or not. i have a large data set. i am using nltk … | |
there is function : int median(int a[], int b[]) { } how do i find the number of elements in a and b? i am doing sizeof(a)/sizeof(int) but it does not give right results. P.S. i need to submit the function only in online compiler so i dont know what … | |
why this [code](http://ideone.com/hfYD8V) is giving me runtime error? | |
what is static function in c++? when should a function is made static? | |
i want to print a 'double' variable upto 8 decimal places without trailing zeroes. for eg: if a= **10.1234** then print **10.1234** if a= **10.00** then print **10** if a= **10.11111111111** then print **10.11111111** (max of 8 decimal places). how to do it? i searched for it and found this: … | |
why it doesnot works for values other than 0 and -1 i mean when i tried to print values of array 'a' after memset() then it shows incorrect values. int a[100]; memset(a,0,sizeof(a)); ///it works memset(a,-1,sizeof(a)); ///it works memset(a,1,sizeof(a)); ///it doesnt | |
what is the use of string.xml file in android? is it like defining global strings if we have multiple .java files in android application? correct me if i am wrong | |
what is lvalue and rvalue? please explain with simple example. | |
Re: @**rithish**...you print the string in reverse order. that not the question. you have to store it too. @**straylight**...your solution to **first part** is: 1. calculate length of string 2. find half of it.(take care of odd and even length) 3. run a loop from starting to length/2 and start swapping … | |
Since in XOR linked list current pointer store the XOR of addresses of previous and next node. my question is how do we XOR two pointers? | |
where is union required? please explain with an example where having union is a better choice than any data structure. | |
int i=512; char *c=(char *)&i; c[0]=2; printf("%d",i); o/p is 514 ![]() | |
Re: 2 loops are enough for all permutation of 'n' bit binary number. for(i=0;i<(1<<n);i++) {for(j=0;j<n;j++) { if(bit is set) print "1"; else print "0"; } } ![]() | |
![]() | Re: Xor all the numbers as you input them. at the end you will left with the number occurs once. |
struct abcd { char q; int w; //long int e; }; why size of this structure is 8 bytes and if i include **long int e** , size becomes 12 bytes? ![]() | |
public class QueueImpl<E extends Comparable<E>> { private int count; private class Node { private E info; Node next; } Node front; Node rear; public E peekMaximum() { Node temp = new Node(); temp = front; Node max = new Node(); max = temp; while(temp!=null) { System.out.println(temp.info); //if(temp.info>max) if((temp).compareTo(max))>0) // getting … | |
int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); | |
are these declaration same? const char *const s; char const *const s; | |
i am using strrev function and also included the header file string.h but i am getting the compile error **‘strrev’ was not declared in this scope**. what else is required? | |
#include<iostream> #include<math.h> using namespace std; int main() { long int t,n; cin>>t; while(t--) { cout<<"abc"; } return 0; } i am getting run time error for t>10000. how to solve it. range of t>1000000 | |
i have made a queue using STL. the queue contains strings only. how to check for a particular string if it present in queue or not? | |
struct node { int info; node *left,*right; }; int main() { struct node *root; root = (struct node*)malloc(sizeof(struct node)); root->info=NULL; root->left=NULL; root->right=NULL; if(root==NULL) printf("%d",root->info); return 0; } why it doesnt print root->info? ![]() | |
#include<iostream> #include<conio.h> using namespace std; struct node { int info; node *left,*right; }; int main() { struct node *root; root=NULL; //root->info=NULL; //root = (struct node*)malloc(sizeof(struct node)); if(root==NULL) //cout<<root->info; cout<<root->info<< " "<<root->left<<" "<<root->right<<"\n"; getch(); return 0; } why it is giving an error? ![]() | |
int a=-3,b=2,c=0,d; d=++a&&++b||++c; printf("a=%d,b=%d,c=%d,d=%d",a,b,c,d); why value of 'c' is not incremented in output? | |
char str[]="S\065AB"; printf("\n%d", sizeof(str)); explain the output. i am getting 5. | |
what is difference between a)strcpy and memcpy b) memcpy and memmov? | |
Why the program is running without line 14? #include<stdio.h> #include<iostream> //#include<conio.h> //#include<math.h> #define FOR(i,a,b) for(int i=a;i<b;i++) using namespace std; int main() { int a[]={1,2,3,4,5,6,7,8,9,10}; int *b; //b=(int *) malloc(sizeof(a)); b=a; //cout<<b; FOR(i,0,10) cout<<b[i]<<" "; //cout<<sizeof(b); //getch(); return 0; } | |
i am new to android application development. i have run hello world program only. now i want to run some sample code. when i try to run them i got this error in new dialog box: "Could not write file: C:\Program Files (x86)\Android\android-sdk\samples\android-15\SoftKeyboard\.project. C:\Program Files (x86)\Android\android-sdk\samples\android-15\SoftKeyboard\.project (Access is denied)" i … | |
![]() | |
Re: [QUOTE]strcat (string3, &string2[start-of-second-half]); This passes the address of the position of string2 you want to add.[/QUOTE] start of second half can be calculated by using strlen and half of it. | |
i am using 'atof' function to convert string into double but it shows the correct value if the string length is 17(max). is ther any function if string length is more than 17? | |
cant we compare two for inequality? i mean if i have a char array 'a' and i want to know the number of digits in an array which is not '4' or not '7' i.e if my array has value 4567778 the output should be 3 as there are three … | |
Re: does that means we can never calculate the answer? | |
In a program i have to calculate pow(2,N) where 0<N<=1000. which data type is suitable for this? I have used unsigned long long int but its range is also limited. | |
| |
Re: after the execution of statement "if(a!=2)" condition is false, then the control will move to "error:" irrespective of whether it is true or not. | |
the question of the program i have posted... There are N numbers a[0],a[1]..a[N - 1]. Initally all are 0. You have to perform two types of operations : 1) Increase the numbers between indices A and B by 1. This is represented by the command "0 A B" 2) Answer … | |
suppose i have 3 functions: a() b() and c() both a() and b() can called c(). if function c() is called how do i know who is the caller?? | |
i have just giving a command textcolor(5+BLINK); cprintf("abc"); it will blink and print abc. but now after this i want to input a string and the problem is the input string also blinking which i dont want. how do i solve this???? | |
![]() | |
hi guys...actually m in deep trouble.i have to make projct in turbo C. but i dont have any time left.Can ny1 help me. can ny1 send me projct so dat i cant lose my marks. plz help meee... | |
|
The End.