^
You didn't pay attention in physics class right?
You can't produce a blinding light with the energy of a blink. That's like powering a 2000W searchlight with a button cell battery.
So there is...
Type: Posts; User: DrZoidberg
^
You didn't pay attention in physics class right?
You can't produce a blinding light with the energy of a blink. That's like powering a 2000W searchlight with a button cell battery.
So there is...
:D :D :p
I fixed the error. This program can search for any string, not just ei.
#include <stdio.h>
#include <stdlib.h>
int main(void){
char c;
char searchstr[]="ei";
Nice. Can you explain how it works?
In C it would look like this:
void lines(int rows) {
for(i=0; i<rows; i++) {
for(j=0; j<rows-i-1; j++) printf(" ");
for(k=0; k<i*2+1; k++) printf("*");
...
#include <stdio.h>
#include <stdlib.h>
int main(void){
char c;
do {
if ((c = getchar()) == 'e'){
I don't believe that there can be NULL bytes in an email but if there really are just replace them with some non-ascii byte before processing.
Every byte with a value of more then 127 is not an...
I made a few corrections.
#include <stdio.h>
int main()
{
int times_tables, correct_answer,user_answer;
int counter;
Hi, my name is Roy, I am a magic addict.
Translated with babel.altavista.com
English -> Japanese -> English
Today, as for my name Roy, it is the common practice person of the magic which is I...
There was something missing.
printf ("The Temperature in Celsius is %d\n\n",cel);
Also it is spelled Fahrenheit.
Java has much in common with C and C++. If you learn Java first it will be easier to learn C and C++ afterwards. And since you will learn java at your Uni this year anyway it might be best to just...
You can use fopen to open a file and fgets to read a specific number of characters from the file.
char buffer[100];
FILE f = fopen("filename","r");
fgets(buffer, 100, f);
btw. characters are...
Also your code is identical to mine except that you didn't forget the linefeeds.
#include <stdio.h>
#include <stdlib.h>
int sum(int x[],int length)
{
int sum=0;
int i;
for (i=0; i<length; i++)
sum+=x[i];
return sum;
You can move an int variable with >> and << but that will not give you the desired effect since an int variable is a binary number but you want to shift the decimal representation of that number.
...
Why do want to invoke a c++ compilation with gcc?
gcc.exe is not the compiler. It's just a wrapper application that calls the compiler.
If you want to use the c++ compiler start it with g++.exe.
gcc invokes the c compiler by default.
g++ invokes the c++ compiler.
So you have to type "g++ <source>" and not "gcc <source>" .
Also the ANSI C++ Standard says it should be #include...
int i;
for(i=0, sum=0; i<5; i++) {
sum+=num_array[i];
}
for(i=0, sum=0; i<5; i++) {
sum+=num_array[sizeof(num_array)/sizeof(num_array[0]) - i - 1];
}
for(i=0, sum=0; i <...
What kind of euations?
You can limit it to simple equations that contains no brackets and only +,-,*,/.
That should not be very difficult.
Try this code. But it can only process simple...
No. That is not a hoax.
That experiment was already performed in the 1970's by Professor Robert White, from Cleveland Ohio.
It was on many news broadcasts and newspapers a few years ago because the...
If the brain was not damaged I really don't see why the baboon should have lost it's memory. The memory resides inside the brain and not in any other body parts.
int GetNrOfDigits(int Number)
{
int Digits = 0;
do {
Digits++;
Number /= 10;
} while(Number > 0);
return Digits;
}
You wrote in your first post:
But now you want a complete code for the first question.
You don't need to output the spaces on the right side of the tiangle since they are not visible anyway.
int i,j;
int height=5;
for(i=0; i<height; i++)
{
for(j=0; j<...; j++)
printf(" ");
for(j=0; j<...; j++)
printf("*");
@buba:
What are you calculating there?
The distance between x and y would be abs(x-y).
Also I don't see what that has to do with calculating pi.