Sunday, August 2, 2009

How do you compare 3 numbers in turbo C using the if statement?

something like this:


if (a%26gt;b)


{ if (a%26gt;c) max=a;


else max=c;}


else


{if (b%26gt;c) max=b;


else max=c;}

How do you compare 3 numbers in turbo C using the if statement?
if(a%26gt;b )


{


if(b%26gt;c)


printf(" a is max number")


else


{


if(c%26gt;a)


printf("c is max number")


}


}


else


{


if(b%26gt;c)


printf("b is max number")


else


printf("c is max number")


}
Reply:if(a%26gt;b%26amp;%26amp;a%26gt;c)


{


printf("a is biggest");


}


else if(b%26gt;a%26amp;%26amp;b%26gt;c)


{


printf(" b is biggest");


}


else if(c%26gt;a%26amp;%26amp;c%26gt;b)


{


printf("c is biggest");


}


that's all over........
Reply:Compare them for what?


How can I stop characters from being echoed on the screen as they're typed using turbo c?

in linux c we can do using functions like tcgetattr,tcsetattr

How can I stop characters from being echoed on the screen as they're typed using turbo c?
Use getch() like this








#include %26lt;iostream%26gt;


#include %26lt;conio.h%26gt;








void main()


{


char blah[15];


int j;


for(j=0; j%26lt;sizeof(blah); j++)


{


blah[j] = getch();


if(blah[j] == '\r')


{


cin.ignore(1);


break;


}


}





}
Reply:If your computer is not working properly while you are working on it, it could be a problem with device drivers, hardware or software.


Detailed instructions at http://tinyurl.com/yk5zpr
Reply:Go to help menu


File :aaaabbbbbbcccccccdddddd,File :1111122222333333344444,Find output of file c using interleaving technique.

Example:





Not the most elegant.. but it works, and you'd likely be able to explain how it works to another person.








#!/usr/bin/perl





my $a = "";


my $b = "";





open FILEA, "%26lt;a" or die $!;


open FILEB, "%26lt;b" or die $!;


open FILEC, "%26gt;c" or die $!;





do {


$a = getc(FILEA);


if ( defined $a ) { print FILEC $a; }


$b = getc(FILEB);


if ( defined $b ) { print FILEC $b; }


} while ( defined $a || defined $b );





close FILEA;


close FILEB;


close FILEC;

hydrangea

I need an code for a function in c++ using recursion?

this function i need to genrat this :


*


**


***


***


**


*

I need an code for a function in c++ using recursion?
I won't write the C++ version, but I think can provide a pseudo code version. Sorry, I can't test the code, you'll need to play with it.





main()


{


printLines(3);


}





void printLines(int x)


{


if (x %26gt;= 1)


{


printLines(x-1);


printStars(x);


printLines(x-1);


}


}





void printStars(int x)


{


if (x == 1)


{


printf("*\n");


}


else


{


printf("*");


printStars(x-1);


}


}
Reply:Void PrintStars(Int Row)


{


Cout %26lt;%26lt;"\n";


For(i=0; i%26lt;Row; i++)


Count %26lt;%26lt;"*";





if Row %26lt; 3 then


PrintStars(++Row);





Cout %26lt;%26lt;"\n";


For(i=0; i%26lt;Row; i++)


Count %26lt;%26lt;"*";


}
Reply:function print(int row = 0){


if(row %26lt; 3)


for(int i=0;i%26lt;=row;i++) {


cout %26lt;%26lt; "*";


}


else


for(int i=5;i%26gt;=row;i--) {


cout %26lt;%26lt; "*";


}


if(row == 5)


return;


print(++row);


}


What is the difference between using Matlab and C for the same application?

There is an application that is already developed using Matlab but to use distributed processing I converted to C and then used MPI routines. The first question that came to my mind is the difference between using Matlab and C.





Does C gives faster output than Matlab (do not consider distributed processing)? Why and under what situations can one prefer C over Matlab?

What is the difference between using Matlab and C for the same application?
I have heard that if you have a graphics application that requires fast updating of the screen, that C++ is better. But I have also heard that for many things, the libraries in MatLab are so well optimized that it is better. But I don't have any actual data comparing the two - this is just what I have read.





But you say you have the code for both - can you just try both and compare? Since it is likely to depend on the application, the best test is your own app.


How can i draw a curve in C++ using graphics??

i want 2 draw d square function graph...can any 1 tell me how 2 do tht thru graphics???

How can i draw a curve in C++ using graphics??
There is a function in the Windows SDK to draw curves, the following is a copy and paste from Microsoft documentation





//------------------------------------...





The Arc function draws an elliptical arc.





BOOL Arc(


HDC hdc, // handle to device context


int nLeftRect, // x-coord of rectangle's upper-left corner


int nTopRect, // y-coord of rectangle's upper-left corner


int nRightRect, // x-coord of rectangle's lower-right corner


int nBottomRect, // y-coord of rectangle's lower-right corner


int nXStartArc, // x-coord of first radial ending point


int nYStartArc, // y-coord of first radial ending point


int nXEndArc, // x-coord of second radial ending point


int nYEndArc // y-coord of second radial ending point


);


Parameters


hdc


[in] Handle to the device context where drawing takes place.


nLeftRect


[in] Specifies the x-coordinate, in logical units, of the upper-left corner of the bounding rectangle.


Windows 95/98/Me: The sum of nLeftRect plus nRightRect must be less than 32768.





nTopRect


[in] Specifies the y-coordinate, in logical units, of the upper-left corner of the bounding rectangle.


Windows 95/98/Me: The sum of nTopRect plus nBottomRect must be less than 32768.





nRightRect


[in] Specifies the x-coordinate, in logical units, of the lower-right corner of the bounding rectangle.


Windows 95/98/Me: The sum of nLeftRect plus nRightRect must be less than 32768.





nBottomRect


[in] Specifies the y-coordinate, in logical units, of the lower-right corner of the bounding rectangle.


Windows 95/98/Me: The sum of nTopRect plus nBottomRect must be less than 32768.





nXStartArc


[in] Specifies the x-coordinate, in logical units, of the ending point of the radial line defining the starting point of the arc.


nYStartArc


[in] Specifies the y-coordinate, in logical units, of the ending point of the radial line defining the starting point of the arc.


nXEndArc


[in] Specifies the x-coordinate, in logical units, of the ending point of the radial line defining the ending point of the arc.


nYEndArc


[in] Specifies the y-coordinate, in logical units, of the ending point of the radial line defining the ending point of the arc.


Return Values


If the arc is drawn, the return value is nonzero.





If the arc is not drawn, the return value is zero.





Windows NT/2000/XP: To get extended error information, call GetLastError.





Remarks


The points (nLeftRect, nTopRect) and (nRightRect, nBottomRect) specify the bounding rectangle. An ellipse formed by the specified bounding rectangle defines the curve of the arc. The arc extends in the current drawing direction from the point where it intersects the radial from the center of the bounding rectangle to the (nXStartArc, nYStartArc) point. The arc ends where it intersects the radial from the center of the bounding rectangle to the (nXEndArc, nYEndArc) point. If the starting point and ending point are the same, a complete ellipse is drawn.





The arc is drawn using the current pen; it is not filled.





The current position is neither used nor updated by Arc.





Windows 95/98/Me: The drawing direction is always counterclockwise.





Windows NT/2000/XP: Use the GetArcDirection and SetArcDirection functions to get and set the current drawing direction for a device context. The default drawing direction is counterclockwise.





Windows 95/98/Me: The sum of the coordinates of the bounding rectangle cannot exceed 32,767. The sum of nLeftRect and nRightRect or nTopRect and nBottomRect parameters cannot exceed 32,767.





Requirements


Windows NT/2000/XP: Included in Windows NT 3.1 and later.


Windows 95/98/Me: Included in Windows 95 and later.


Header: Declared in Wingdi.h; include Windows.h.


Library: Use Gdi32.lib.





//------------------------------------...





You can also use the "paths" section of the GDI


http://msdn2.microsoft.com/en-us/library...





or you can read all about GDI


http://msdn2.microsoft.com/en-us/library...





Or even use GDI+ or even OpenGL or DirectX





http://msdn2.microsoft.com/en-us/library...
Reply:draw a circle and then erase some of it for the opening on the c and for the pluses you can type them
Reply:You have to either:


Define the draw function in terms of a mathematical function as in y=sin(x) which is a curve.


OR


Define the draw function so that it starts at some coordinate, draws to the next, and the next in a curvy fashion, step by step. You can use a loop or try separate compilation with a program like Visual C++





I don't know what the square function graph is though.. sorry.


Hope this helps.
Reply:Drawing environments are platform specific, and you haven't specified what platform you are on, so no one can help you very much. However, all platforms have a routine like Drawline(x0,y0, x1, y1) that draws a line between the two specified points. If you have a function y=f(x), you can use a for loop to step through x, and evaluate f(x) for the y coordinate.





Connecting points with lines gives the smoothest output, but you might find it easier initially to set x0=x1, and y0=y1, meaning that you just draw a simple point at each x value.
Reply:am looking for the same thing.....if anyone can help please let me know


How do I get to Washington D.C. using the bus?

I live in Middlesex County, New Jersey and can not afford Amtrak. Any suggestions for a cheap way to get there?

How do I get to Washington D.C. using the bus?
You can catch the bus from Trenton, NJ all the way to DC. The cost is going to be $30-40 each way. You could find a job and save money or ask your friends or relatives to pay your way.





http://www.greyhound.com
Reply:If you can get to Philadelphia, you can also take a Chinatown to Chinatown bus for only $15 one-way or $28 round-trip:





http://www.ivymedia.com/
Reply:Hitchhiking is about the cheapest way to do it. Also, you could travel for free as a driver if someone is in need of your services. Essentially you can offer to drive someone to DC in their car so that they do not have the hassle of driving themselves. Some people are very old or very nervous behind the wheel and you can provide a wonderful service that helps both of you.. oh.. and you can get a few bucks in your pocket for your services.
Reply:Greyhound

hawthorn

Need help making a power function in C using loops. This is what i got so far.?

#include %26lt;stdio.h%26gt;


#include %26lt;stdlib.h%26gt;





void float DP(double x, int n)


{


double x, DP;


int n;





DP=pow(x,n);


printf("%d to the %i power is %d", x, n, DP);








}








int main()


{


float x, DP;


int n;





scanf("%d%i", x, n);


DP(x, n);





printf("Answer equals %d\n", DP);





return 0;


}

Need help making a power function in C using loops. This is what i got so far.?
double DP(double x, int n)


{


double result = x;





for(int i = 1; i %26lt; n; i++)


{


result *= x;


}





return(result);


}
Reply:Oops, misread what you said in my first response -- you said you need to use loops. Very well:





double DP(double x, int n) {





double result = 1.0;


for(int i = 0; i %26lt; n; i++) {


result *= x;


}





printf("%f to the %d power = %f\n", x,n,result);





return result;


}


What is the c++ code for using characters instead of nos in the 'if' statement?I need to know this ASAP.

basically when we use the 'if' statement in c++ we only use nos.but using strcmp in c++ we can use characters.i need to know the code and way it is entered as well as the functions in it.

What is the c++ code for using characters instead of nos in the 'if' statement?I need to know this ASAP.
Your Question is not very clearly,


we can use if statement with characters...


eg. if (a[1]=='a')


do something


else somw other thing.





what exactly u r asking for...
Reply:strcmp(a,b). This gives an integer. if you have String blah = "a" and String blah2 = "b" (don't have to be characters), and compare


strcmp(blah,blah2) you'll get a number less than 0, because a is lexocigrayhically less than b. Likewise, strcmp(blah2,blah) would yield a value greater than 0, and if both blah and blah2 = "a", it would yield eactly 0.


How can i make a program in c++ using string.h, conio.h and iostream...?

i need to make a program called palindrome.. this will reverse the word/s that you input, like wow, bar crab, when you reverse those word/s you will get the same word/s... my problem is i dont know how make this program..i hope anyone can help me with this...


thank you

How can i make a program in c++ using string.h, conio.h and iostream...?
If u r asking for complete code then we wont give u the code.


I can help u with a simple logic.


u have to make a program of pallandro, in which when u input a string/word, it will tell u wether the given string is pallandrom or not.





here u can do these things ...





1. input a string in a variable say 'a', using cin (for that u have to include iostream.h)


2. reverse the string in the variable a and store it in another string variable say 'b' (for that u have to use string reverse function. u have to include string.h)


3. now compare 'a' %26amp; 'b' string variables. if they r same the input string is Pallandrom, else it is not a pallandrom.


4. including conio.h, u can use clrscr() %26amp; getch(); functions.
Reply:#include %26lt;iostream%26gt;


#include %26lt;string.h%26gt;


using namespace std;





void main()


{


char inputLine[256];





//input the text


cin.getline(inputLine,255);





//reverse the string


_strrev(inputLine);





//output the reversed text


cout %26lt;%26lt; inputLine %26lt;%26lt; endl;


}
Reply:#include %26lt;string.h%26gt;


#include %26lt;conio.h%26gt;


#include %26lt;iostream.h%26gt;





private string (variable name);


{


insert your programme code here


}
Reply:Why do you want to use conio.h? And why do you want to use old style C++ header files?





Here is what I would start with:





#include %26lt;string%26gt;


#include %26lt;iostream%26gt;





using namespace std;





string reverseWord(string %26amp; s) {


//do something here


}





int main(void) {


//read in the string


string s;


cin %26gt;%26gt; s;





//reverse s using your function and output the result





return 0;


}





This page may be useful for you as a general C/C++ reference:


http://www.cppreference.com/index.html


If i delete something from my P.C, using .."delete with norton protected files" can it be retreived?

yes, but you must not do anything else to the hard-drive (like copy/move/delete/create files) and use a special undelete utility to find those files.

marguerite

How can I write a mergeSort in c++ using linked list?

http://www.cs.uaf.edu/2006/spring/cs311/ points to source code at http://www.cs.uaf.edu/2006/spring/cs311/...


How many ordered lists of length 10 using letters from {A, B, C} use exactly 5 "A"s?

You have 10 letters and 5 have to be "A"s.





Use combinatorics...





10 choose 5 = 252





There are 252 different ways of filling A's in 5 slots.





Now you need to find how many different ways of filling B's and C's in the other five, which is simply:





2 x 2 x 2 x 2 x 2 = 32





252 x 32 = 8064





There are 8064.

tropical flowers

How do i create a process in c using windows and linux.?

any additional link or tutorial will help

How do i create a process in c using windows and linux.?
um, that makes no sense. Any program you create in C whether it be in windows or linux will be a process.


What is program code in turbo c using array?

you must enter 3 name of a students with 3 grade in each student and the output are will be this





first table will be in alphabetical order


and the second table will be in highest to lowest order


for example:





calbin 90 91 90 ave is 90%


justin 80 80 80 ave is 80%


mark 85 85 85 ave is 85%





calbin 90 91 90 ave is 90%


mark 85 85 85 ave is 85%


justin 80 80 80 ave is 80%











please HELP me!!!!! SOS

What is program code in turbo c using array?
What do you need help with??? Try to program it yourself and when you run into problems, post here.


Find quadratic function y=ax^2+c using points....???

1).(0,2) and (3,5)


2.) (2,5/2) and (0, -1/2)

Find quadratic function y=ax^2+c using points....???
1.


Putting x = 0, y = 2 in y = ax^2 + c:


a0^2 + c = 2 ...(1)





Puttijng x = 3, y = 5 in y = ax^2 + c:


a3^2 + c = 5 ...(2)





From (1), c = 2.


Substituting for c in (2):


9a + 2 = 5


a = 3 / 9 = 1/3.





The function is:


y = (1/3)x^2 + 2.





2.


Using the same technique:


5/2 = 4a + c ...(3)


-1/2 = c





From (3):


5/2 = 4a - 1/2


6/2 = 4a


3 = 4a


a = 3/4.





The function is:


y = (3/4)x^2 - 1/2.


Find quadratic function y=ax^2+c using points....???

1).(0,2) and (3,5)


2.) (2,5/2) and (0, -1/2)

Find quadratic function y=ax^2+c using points....???
1) For x=0 and y=2 ==%26gt; 2=a.0+c


2=c


For x=3 and y=5 ==%26gt; 5=a.3+c


5=3a+2


3=3a


1=a


So our equation is y=ax^2+c


y= x^2+2


2) For x=0 and y=-1/2 ==%26gt; -1/2=a.0+c


-1/2=c


For x=2 and y=5/2 ==%26gt; 5/2=a.2+c


5/2=2a-1/2


2=2a


1=a


Our equation is y=ax^2+c


y= x^2-1/2

sound cards

How to write a program in c using nested loops?

to write a program having output as


*


**


***

How to write a program in c using nested loops?
Just as decisions can be nested, so can loops; that is, you can place loops inside other loops





#include %26lt;stdio.h%26gt;


int main()


{





int x, y;





for(x=0;x%26lt;4;x++)


{


for(y=0;y%26lt;x;y++)


{


printf("*");


}


printf("\n");


}


return 0;


}
Reply:#include %26lt;iostream.h%26gt;


#include %26lt;conio.h%26gt;





void main()


{


int i,j;


for (i=0;i%26lt;3;i++);


for (j=0;j%26lt;i;j++);


printf("*");


getch()


}


I need to create a random function in c++ using this formula =f(x) × 100 , f(x) = (pi + x)^5?

i need the help fast plz

I need to create a random function in c++ using this formula =f(x) × 100 , f(x) = (pi + x)^5?
I can give you video tutorial on how to use the rand() function:





http://xoax.net/comp/cpp/console/Lesson2...





I hope that helps. Could you give some clarification?
Reply:I shall give you some quick and dirty code which implements the formulae you have given me. It is random in the sense that anything I do is random and unfocused when it's quick and dirty. Its output is not random because it always seems to return 1. Obviously, you'll have to debug it yourself (but this sounds like homework so you should anyhow) and this may help anyhow.





#include %26lt;iostream%26gt;


#include %26lt;cmath%26gt;





using namespace std;





float funky(float );





int main()


{





double x, Rand;


int i;





cout %26lt;%26lt; "Enter a number:";


cin %26gt;%26gt; i;





x=(double) i;





Rand=funky(x)*100.0;





cout %26lt;%26lt; rand;


return 0;


}





float funky(float x)


{


double pi=3.14159;


double temp1, temp;


temp=(pi*x);


temp1=pow(temp,5);


return temp1;


}


My harddrive has 2 partitions c: and d:. If I delete c: using the xp install cd, will the 2 partitions merge?

I have many files in d:. I don't want the 2 partitions to merge.

My harddrive has 2 partitions c: and d:. If I delete c: using the xp install cd, will the 2 partitions merge?
If you want to merge the partitions you might need something like Partition Magic.
Reply:if u only delete ur c: partican ur D: wont be deleted
Reply:no, they will not merge.





If you delete C: all the stuff stored on C: will be gone. Gone I say!





and that STILL won't MERGE them, to recover both partition's space into a single partition you will need either a partition re-sizing utility, or you can delete BOTH partitions and create a NEW partition C:





If what you want to to resize and move space between the two partitions, get a copy of gparted





http://gparted.sourceforge.net/livecd.ph...
Reply:Do not delete C: just format it and install. C: is the Boot Volume , you can reformat it and it is 'cleaned' then fresh install and all ok. If you actually delete C: you may lose the Boot Sector, not good. But you can always reformat it with a good boot sector OS or boot.ini.
Reply:You can't delete the primery partition(C:) when extended partition exists but you can alter the size of partitions with third party softwares and c: can be formated without disturbing the other partitions(d:). to merge all partitions use Fdisk and delete logical drives first and delete extended dos partition and primery partition(c:) all drives and all data will be lost.Many partition softwares are avilable to resize and format the partitions without losing data.


wish you all the best.


How do i tune my guitar to drop c using an electronic tuner that doesn't have c or f?

You would need to get a chromatic tuner. BOSS makes chromatic tuners such as the TU-12.

liama-song

How to design a Snake and ladder game using C++(using Graphics)?

Here is some source codes that might be helpful to start with: http://www.cprogramming.com/cgi-bin/sour...


MS-DOS compatability mode-DRIVE C using ??? BIOS a mess!! Lost CD-ROM ?? What do I do???

SYS INFO: IRQ 11 S3 INC TRIO 3D


IRQ 11 IRQ HOLDER FOR PCI STEERING


IRQ 14 PRIMARY IDE CONTROLLER (DUAL FIFO)


IRQ 14 INTEL 82371AB/EB PCI BUS MASTER IDE CONTROLLER


IRQ 15 INTEL 82371AB/EB PCI TO USB UNIVERSAL HOST CONTROLLER


IRQ 15 IRQ HOLDER FOR PCI STEERING





*****WINDOWS 98 SE IBM COMPUTER MODEL 6862 --YEAH OLD*****


I DONT KNOW WHAT OTHER INFO YOU NEED PLEASE LET ME KNOW...





THANK YOU SOOOOOOOO MUCH

MS-DOS compatability mode-DRIVE C using ??? BIOS a mess!! Lost CD-ROM ?? What do I do???
have you done a virus scan ? back in the old days (of win98), computer viruses used to knock c-drives into compatibility mode.





if you've done that, you can always remove them from the device manager and reboot - that will make windows re-recognize them and that might get rid of the problem too (tho you'll be prompted to reboot several more times).





i've also had that problem if the bios settings were messed up (say, if the floppy drive was deactivated or the cd-rom had its settings misconfigured).





good luck !!
Reply:GO TO CONTROL PANEL UPDATE CD-ROM DRIVER IF NOT GET THE 98 DISC AND RE FORMAT


GOOD LUCK MINES OLDER THAN YOURS


ACER


RE-BUILT 3 TIMES


HAPPY EASTER


How do you find the c using mean value thm for f(x)=6*sq root of x +9 on interval (1,6), mean slope=1.73927692

You are in calculus and having problems with algebra? And your f(x) is 9 + 6 sqrt(x),certainly you can put this into the theorem and solve.


Plz suggest me a mini-project in C++ using linked lists/trees/graphs.i am a firsttimer se student.time 1 month

How about writing a "library" program that will organize your books by author, title, ISBN number, genre, and reading level.





That should keep you busy for a few months.

garden state

This program is to be made in c using single for loop.?

1


11


121


1331

This program is to be made in c using single for loop.?
int ele = 1;


for(int i=0; i%26lt;=3; i++){


printf (ele);


ele *= 11;


}





try this code you'll get the result...


and bcoz i am not that much familiar with C so plz check the syntax...


otherwise the code will run...
Reply:foreach(Question q in myHomework){


q.webPost("Yahoo! Answers");


}
Reply:You just have to times it time 11, somthing like





#include %26lt;stdio.h%26gt;


int main()


{


int i;


for(i=1;i%26lt;=1331;i=i*11)


printf("%d\t\n",i);


return(0);


}





Why do you need this, I'm learning it from abook and I knew it off the top of my head!!





Please rate me best!!


Tell me any program in c++ using malloc functions?

What is the best way to learn computer languages

Tell me any program in c++ using malloc functions?
The best way to learn computer languages is to write a lot of code. Of course you'll also want to read a book or two, but to become an expert you have to primarily exercise.





Note that mixing malloc and new is poor practice. The link discusses this as well as has sample code for malloc: http://www.codeproject.com/tips/newandma...





Finally, my personal choice for learning programming these days would be Python (www.python.org).
Reply:First of all, we don't need malloc in c++ as we have new and delete there.





but if you still want to use it then there are many tutorials on net. you can find them on sites like www.dreamincode.net which are technical forum sites.





And all you need is practice and more practice.
Reply:put some logic on the paper and start executing that logic using language. You will fine bunch of online help for programming. Just google it. and here is the link where you will find program in c++ which uses malloc function. http://www.java2s.com/Code/Cpp/Language/...


I want to solve minimal spanning tree/branch and bound algorithm problem using MPI /Cor C++, any code ?

I want to solve minimal spanning tree/branch and bound algorithm problem using MPI /C or C++, i did find some answers in google but aint working, did anyone take parallel computing course , can someone give me pointers to it ?

I want to solve minimal spanning tree/branch and bound algorithm problem using MPI /Cor C++, any code ?
You may find this tool useful in solving your problem.


http://osl.iu.edu/research/pbgl/


Sir,I am using a pentium4 3.2 PC in India,Kerala.It getting over heated when usingmore than 10mints,No a/c?

Using a/c is not possible due to many problems.What is the real problem?.how could I overcome .

Sir,I am using a pentium4 3.2 PC in India,Kerala.It getting over heated when usingmore than 10mints,No a/c?
I think there is some problem with your fan. I am using computer in bangladesh without AC and sometime in summer I run my computer for 3 to 4 hours without any problem. Consult with your vendor and if you are covered with warranty claim co change your CPU fan.
Reply:Install more fans in the case, try a new heat sink. If the issue still occurs, try moving the case away from the wall or even opening up the case so air can easily flow in. Keeping the system in a cool area will help also.
Reply:Install more fans in the computer case. Or try a better heat sink for the CPU.

funeral flowers

C and C++ programm is using 100% of my CPU. pls help?

When I'm running C or C++ on my Windows XP; (just the C/C++ Program, no program inside it or running) and hardware is Intel Pentium 3; 724 mhz Processor with 128 RAM. It is using the CPU 100% from time of launching till end. But in Core2Duo 1.6 ghz Processor %26amp; 1 GB Ram with the same XP OS it is using 10 to 20% of CPU. Can any one help me Plsss pls pls. and can tell me what will happen if I use it on Windows 98, or ME on the old CPU.

C and C++ programm is using 100% of my CPU. pls help?
Same problem I was also facing.


It is because memory required for C/C++ in Windows Xp is large.


So if you upgrade your RAM it will do.








2nd option is not to run that C/Cpp in full screen.


If you are using dos based C/Cpp like TurboC then use alt+enter and use it in normal screen and not in full screen.





It reduces cpu usage.








In case after that you are still in problems then select idle memory/usage option properly from properties of dos based programs.


Under memory you see idle period option. Increase that. It will also reduce your CPU usage.





Thank you.


Write a program in C using call by reference?

program to calculate the age of a person through month, date and year entered by the user?

Write a program in C using call by reference?
The call by reference is one of the time and memory saving ways to call a function.





Go this way...





suppose a main function is their:-





main()


{


int a,b;


int c;


a=30;


b=40;


c=add(a,b);


printf("\nValue of c=",c);


}








and the function for add is:-





int add(int %26amp;x,int %26amp;y)


{


int z;


z=x+y;


return z;


}





now what happens here is the "%26amp;" specifies that the variables used are actually diff name for the original variables. Hence if you change the variables in function then the original variables will also be changed....





ask more to me on...arjun_devane@yahoo.com
Reply:what are you asking ?





by the sound of it anything will do provided the call uses a reference rather than the value as in





myproc (byref myvar)


Anyone know how to do this C++? using simple c++ language?

Write a program that determines the letter that lies halfway between two letters of the


alphabet as input by the user. For example, if the user inputs ‘A’ and ‘Z’, the output


should be ‘M’. Do you know how to deal with upper vs. lower case letters?

Anyone know how to do this C++? using simple c++ language?
#include %26lt;stdio.h%26gt;


#include %26lt;ctype.h%26gt;





int main(int argc, char **argv) {


unsigned char c1, c2;





printf("Enter the first char: ");


c1 = toupeer(getc(stdin));


printf("Enter the second char: ");


scanf("%c", %26amp;c2);


c2 = toupper(getc(stdin));





printf("Middle character between %c and %c is %c.\n", c1, c2, (c1 + c2) / 2);


return 0;


}
Reply:I think you guys just answered a coursework question =)
Reply:This code will work if both characters are of the same type. If one is a capital letter and the other is not, then the specification should tell you what to do; it's not normally left up to the coder to make this up....





char first, second, middle;





// Both capital letters, in order


first = 'A';


second = 'Z';


middle = ((int) first + (int) second) / 2;


printf("The character in the middle is '%c'.", middle);





// Both normal letters, NOT in order


first = 'y';


second = 'c';


middle = ((int) first + (int) second) / 2;


printf("The character in the middle is '%c'.", middle);


Write a program in c using functions to implement sine series?

Did you mean this?:





#include %26lt;math.h%26gt;


#include %26lt;stdio.h%26gt;





int main()


{


int step = 8;


float step_size = 2.0*M_PI/step, x;


for (x = -1.0*M_PI; x %26lt;= M_PI; x += step_size)


printf("%2.3f\t%2.3f\n", x, sin(x));


return 0;


}

floral design

Write a program in C using functions to implement Sine Series?

Plz, Give me the code of this program.


Plz.

Write a program in C using functions to implement Sine Series?
double sin(double x)


{


double numerator = x;


double denominator = 1.0;


double sign = 1.0;


double sin = 0;





// terms below define the number of terms you want


int terms = 10;


for ( int i = 1 ; i %26lt;= 10 ; i++ )


{


sin += numerator / denominator * sign;


numerator *= x * x;


denominator *= i*2 * (i*2+1);


sign *= -1;


}


return sin;


}


Help. i dont know how to solve this loop program...using turbo c?

using turbo c


the output should be like this





Loop Program


--------------------


enter 1st integer:


enter 2nd integer:


enter 3rd integer:


enter 4th integer:


enter 5th integer:


enter 6th integer:


enter 7th integer:


enter 8th integer:


enter 9th integer:


enter 10th integer:


=====RESULTS======


sum=


average=


smallest=


largest=


no. of odd=


no. of even=








thank you... please consider this as a challenge.. even though im just


a beginner.


:Dty.

Help. i dont know how to solve this loop program...using turbo c?
Uses switch case actually


Very easy


i have a sample here,.. wait





sorry cant locate it





Read more bout switch cases





or contact me 2moro


What is the programming code to interface the USB port using Visual C++?!?

I'm a student and doing my final year project in my university. This assignment requires me to transmit data/signal from the computer (prompt by the user via Graphic User Interface, developed using visual C++) to the Bluetooth dongle at the USB port.





I've completed doing the GUI and I'm having problem to make the data/signal able to transmit to the Bluetooth dongle attached at the USB port.





I look forward for ideas and opinions in getting the right programming code or method to fulfill the task.





Thank you.

What is the programming code to interface the USB port using Visual C++?!?
check out http://www.pscode.com for great source code samples.
Reply:Depending on what you want to do it may be a case of using the driver that came with the dongle to send the message using one of the protocols supported (bluetooth serial, OBEX or TCP/IP).





Otherwise, try here: www.usb.org


Sugest a mini project in C++ using DLL/SLL/TREES/GRAPHS.To be given in a month.?

Preferably nothing to do with library systems, or anything relating to a data-base somethin different would be greatly appreciates.

Sugest a mini project in C++ using DLL/SLL/TREES/GRAPHS.To be given in a month.?
Try a graphical network analyzer!
Reply:Write a Sudoku solver. It's been done many times before but it seems to encompass the things you want to play with and there is source out there if you need a starting point or get stuck.

chelsea flower show

Trying to programm an Employee database in C++ using Polymorphism and std::Vector could anyone help me plz ?

its an assignment and its very urgent,just cant work out how I can use std::vector as a container for 3 types of emplyees:"Manager,Engineer and researcher" which should be drived from Employee class.


The problem is I cant access any drived class method (e.g data.printstat() ) from a vector arrey data:





//std::vector.


vector%26lt;Employee%26gt; data;


//costructing a Manager //


Manager man (name , salary ,Exp);


data.push_back(man);


data[0].printstat();//%26lt;=======doesnt work!





I have made printstat() in Employee(which is base part) virtual.





why isnt working??!!!





could any one be kind enough and send me a suggested code??!!!





many thanx

Trying to programm an Employee database in C++ using Polymorphism and std::Vector could anyone help me plz ?
Because an std::vector make a copy of the instances you push into it. But your vector is of type employee, so each entry hold the space for the data needed by the base class only, everything coming from the derived class has no where to go, only the base class stuff is kept by the copy pushed into the vector. So whatever the employee type was before, the copy is an Employee, and only an Employee.





This is sometime called slicing an object.


The solution is simple, have your vector contains Employee pointers and not employee values. (you need to make sure that the employees are not destroyed while the vector hold their address thought)





Polymorphism work with pointers. You hold pointers to the base class that are in fact pointers to derived class and then when you call a virtual method on one of them, you call the appropriate derived class virtual method (if implemented of course) for the actual type of the object referred by the pointer.


Wav files in C++ using MMIO?

I can record and save but want to be able to start write continuously to a wav file as recording takes place. Is there a way to add more than one data chunk? Or just continue adding to a single data chunk indefinitely?

Wav files in C++ using MMIO?
Read it straight from the boss, here is what Microsoft has to say on using MMIO to write a WAV file:





http://msdn2.microsoft.com/en-us/library...


Fibonacci sequence in C# using for loops??

I want to display 1st 20 numbers in sequence but don't have a clue please help.

Fibonacci sequence in C# using for loops??
The syntax here will not be right, but this approach will work








F[1] = 0


F[2] = 1





For N = 1 to 20 do


If (N %26lt;%26gt; 1) %26amp;%26amp; (N%26lt;%26gt;2) Then


F[N] = F[N-1] + F[N-2]


Endif


Print "Fib " N " = " F[N]


End For
Reply:int number1;


int number2;


number1=number2=1;


Console.WriteLine("{0}", number1);


while (number2 %26lt; 20)


{


Console.WriteLine(number2);


number2 += number1;


number1 = number2 - number1; Report It

Reply:Hi,


I don't know how to program in C# but I did write a similar program in java. The syntax is the same. I will explain it and just show you the function method I used, because I am not sure what you are using to display the results.





Basically in your constructor you want to have a loop which will run 20 times, run a function method to calculate the fibonacci number and then display such result. This is what it may look like:


for(i=1;i%26lt;=20;++i)


{


display.writeString("The "+i+"th Fibonacci number is "+Fib(i)); // this will pass the value of i to the method and display that result


display.writeEOL(); // End of line


}





Your function method might look something like this:


private int Fib(int n){


if(n%26lt;=1){


return n;


}





else{


return Fib(n-2)+Fib(n-1);





}


}





I would try to help more but I have never programmed in C#. Hopefully you can translate this information :). To be honest I had trouble at first and had to look at source codes done in C.
Reply:I do not know what C# means.


if(n ==0 ) return 0


if(n == 1) return 1


if (n %26gt; 1) return (f(n-1)+f(n-2))


Ignore 'return.'


The above is the formula to generate the sequence.


Here are the the first 21 numbers.


The first number is 0. The seond is 1. Each number is the sum of the 2 previous numbers.


0


1


1


2


3


5


8


13


21


34


55


89


144


233


377


610


987


1597


2584


4181


6765


2 partitions c and d. If I delete c using the XP install cd, will I be be able to install fresh xp in it later

Will I not lose my data files in d:?

2 partitions c and d. If I delete c using the XP install cd, will I be be able to install fresh xp in it later
Yes you able to install fresh xp in it (in drive C:). The files install or save in drive d: will not be deleted unless you delete or change the partition of your harddrive.
Reply:yes....1st delete the c partition.then create it again.then install a fresh xp in it.


your d-drive would be completely safe.
Reply:yes you can deleate c:/, the data in d:/ will remain.
Reply:Yes, you can install XP. All the contents in the C: drive will be lost not the D: drive
Reply:You will lose you data files on drive d my question is why is it partitioned and since it is why would you want to unpartition it

apple

How can i add music to windows movie maker using a c.d.?

Is there anyway i can add music to windows movie maker using a c.d.?

How can i add music to windows movie maker using a c.d.?
Rip the audio from the cd using windows media player. Then you can import it to your movie.


Create a program in C# using a switch to determine a gender M for Male F for Female?

I want if they enter that they are female and click the male doorbutton a message box will pop up and say wrong door and visa versa

Create a program in C# using a switch to determine a gender M for Male F for Female?
#include%26lt;stdio.h%26gt;


#include%26lt;conio.h





main()


{


char gender, f, m;


printf("If you are Female, type in the letter F.\nIf you are Male, type in the letter M");


scanf("%c", %26amp;gender);


switch(gender)


{


case f:


case F: printf("Female"); break;


case m:


case M: printf("Male"); break;


default: printf("There's only male and female on this planet");


}





getch();


return(0);


}





Hope this helps...'cause i'm not sure if this is really what you want...i don't really get your question actually


Why does my hp Pavilion zv6000 shuts down when I'm using a/c adapter?

My hp Pavilion zv6000 shuts down when I'm using a/c adapter,but it does'nt shut down when I'm using the battery.

Why does my hp Pavilion zv6000 shuts down when I'm using a/c adapter?
You have a bad AC adapter port... it came unsoldered. laptop is irreparable. Give it to goodwill. Plus its outdated.....


How to make a C using a bar chord, how to make an E using a bar chord?

can anyone point me to a good web reference for all the bar chords?

How to make a C using a bar chord, how to make an E using a bar chord?
Try this:


http://www.guitarchordsmagic.com/guitar-...

augustifolia

Wap in C using functions to implement Sine series.?

using sin function in header file math.h


How to make a program in c using blink, how to input color in c program, how to use the goto function?

Ariston here is your link find out





http://www.pjrc.com/tech/8051/board3/bli...


http://www.friedspace.com/cprogramming/u...


http://www.plethora.net/~seebs/faqs/c-ia...


http://www.lysator.liu.se/c/bwk-tutor.ht...





Good luck