hi i don't know why but some of the values change on their own when i run this code. why?
#include <stdio.h>
#include <math.h>
int main(void)
{
double a = 111 * pow(10,20);
double b...
Type: Posts; User: Mohsen Abasi
hi i don't know why but some of the values change on their own when i run this code. why?
#include <stdio.h>
#include <math.h>
int main(void)
{
double a = 111 * pow(10,20);
double b...
for example both short and unsigend short take 2 bytes of memory and from 0 to 65535 or from -32768 to 32767. so if both types take up 2 bytes of memory, how does the computer realize one is signed...
hi i want to know what is the maximum value of data type long double _Complex.
for integer data types we use limits.h and for floating-point float.h. but what about _Imaginary and _Complex where can...
hi as the title of the thread says i don't know how to get the precision and max value of double and long double. if I'm not mistaken (this is from a long time ago) by including the limits.h you can...
hi first look at this code:
#include <stdio.h>
#include <stdlib.h>
void binary(char byte) {
unsigned char mask = 0x80;
for ( ; mask; mask >>= 1)
putchar(byte & mask ? '1'...
hi i don't know why but this code produces no output. I'm a beginner i don't get. why doesn't this work?
#include <stdio.h>
int main()
{
char c[] = "0110";
if (c == "0110")
...
i need to know how can i split a string of characters into two.
i have one str[8] array and want two str1[4] and str2[4] arrays with str1 having the first half of str and str2 the rest.
how can i...
I've read the book teach yourself c in 21 days from sams publishing and it didn't cover what you just did in the binary function. can someone explain to me what he did? also i need a book...
hi take a look at this source code (it doesn't have bugs):
#include <stdio.h>
#include <stdlib.h>
int main( void )
{
FILE *fp;
int c;
thanx i get it now. i'll get to writing it immediately
my problem is after i open a file in "rb" mode i want to start from beginning and read one byte at a time assign the current byte to a variable so i can perform operations on it and then save the...
the title says it all.
here's an example code i tested too:
#include <stdio.h>
#include <string.h>
char * str;
int main( void )
i changed
else if (state = OUT)
to
else if (state == OUT)
and it now it works thanks for the help and your suggestions
hi I'm reading a book called the c programming language second edition by dennis ritchie and one of the source codes in section 1.5.4 doesn't work properly.
here's the code:
#include <stdio.h>...
hi I'm in desperate need of a book about c++ that introduces problems and solutions but i could only find books in this genre in python and some other languages. does anybody know a good book about...
hi the code I'm talking about is this :
#include <iostream>
int main()
{
using namespace std;
char h[] = "Hello"
for (int i = 0; i = 5; i++)
cout << h[i];
i fixed this with this code:
#include <stdio.h>
int main(void)
{
float pint, cup, ounce, tablespoon, teaspoon;
printf("How many cups? ");
scanf("%f", &cup);
pint = cup / 2;
hi i'm doing an exercise from C Primer Plus. the problem is this:
this is the code i wrote:
#include <stdio.h>
int main(void)
{
float pint, cup, ounce, tablespoon, teaspoon;