Search found 384 matches

by rakeen
Sat Aug 10, 2013 10:52 pm
Forum: Computer Science
Topic: Count The Number Of Solutions
Replies: 2
Views: 1608

Re: Count The Number Of Solutions

Just add a counter! int main () { int a,b,c,d,n,count=0; for(a=1;a>=0 && a<=7;a++){ for(b=1;b>=0 && b<=7;b++){ for(c=1;c>=0 && c<=7;c++){ for(d=1;d>=0 && d<=7;d++){ n = a + b + c + d; if(n==7){ count++; printf("%d %d %d %d\n",a,b,c,d); } } } } } printf("%d",count); system("pause"); return 0; }
by rakeen
Fri May 10, 2013 2:29 pm
Forum: Computer Science
Topic: GUI Java
Replies: 2
Views: 1541

Re: GUI Java

I used Intro to Java by Daniel Liang to get the basic idea. You can look up chapter 12,14,15,16 and 17. Java GUI is a vast thing and there're many tools in it; that's why there are separate books written for it. You should refer to those.(I haven't read any books on it so... I can't refer anything) ...
by rakeen
Fri Nov 23, 2012 12:01 pm
Forum: Computer Science
Topic: Help:Graphics in C
Replies: 2
Views: 1623

Help:Graphics in C

#include<graphics.h> #include<conio.h> main() { int gd = DETECT, gm; initgraph(&gd, &gm, "C:\\TC\\BGI"); ellipse(100, 100, 0, 360, 50, 25); getch(); closegraph(); return 0; } Can anyone explain what are DETECT,gm,initgraph,closegraph?and what do they do? Are libraries included in the IDE or the com...
by rakeen
Sun Nov 18, 2012 10:02 pm
Forum: Computer Science
Topic: Calculate ln(x) without math.h
Replies: 7
Views: 3164

Re: Calculate ln(x) without math.h

Then write a function exp(x) to calculate (e^x) and use binary search.
you mean... if logx=p then $e^p=x$. then trial and error?!

However mahi's method worked :)
by rakeen
Sun Nov 18, 2012 12:09 pm
Forum: Computer Science
Topic: Calculate ln(x) without math.h
Replies: 7
Views: 3164

Re: Calculate ln(x) without math.h

You can't plug 3 or 4 or 5 in the series since the series is for $-1<x<=1$ only
by rakeen
Fri Nov 16, 2012 10:16 am
Forum: Computer Science
Topic: Calculate ln(x) without math.h
Replies: 7
Views: 3164

Calculate ln(x) without math.h

Write a program which will calculate $ln(x)$. You can't use math.h library. And the code should also be able to find the $ln(x)$ for $x>1$
by rakeen
Mon Nov 12, 2012 1:49 pm
Forum: Computer Science
Topic: Calculating Trigonometric Functions
Replies: 13
Views: 3538

Re: Calculating Trigonometric Functions

^ forgot to comment those... x ia the value that we're gonna put in, and it must be in RADIAN. As we won't be using math.h library thus we won't be using fact() function either. So, we are calculating the next term by multiplying a factor to the previous term, thus avoiding the factorial thing. You ...
by rakeen
Mon Nov 12, 2012 1:38 pm
Forum: Computer Science
Topic: Calculating Trigonometric Functions
Replies: 13
Views: 3538

Re: Calculating Trigonometric Functions

Code: Select all

#include <stdio.h>
int main()
{
   int i;
   double s=0,x,t=1;
   scanf("%lf", &x);
   for(i=1;i<=20;i++){
      s=s+t;
      t=t*((-x*x)/((i+1)*(i+2)));
   }
   printf("%lf",s);
   return 0;
   }
by rakeen
Mon Nov 12, 2012 12:25 pm
Forum: Computer Science
Topic: Finding Vowel,Consonant and Other
Replies: 2
Views: 1468

Finding Vowel,Consonant and Other

Write a program that will take a character from user and will print if it is vowel,consonant or 'other'(i.e 1,3,null). Use switch case And if-else.
by rakeen
Sat Nov 10, 2012 9:19 am
Forum: Computer Science
Topic: Problem executing a Program
Replies: 5
Views: 2065

Re: Problem executing a Program

and is there any rule that I've to use the same variable in the Controll Expression?