View Single Post
Ambitious contributor
11Jun2012,23:49  
pein87's Avatar
why are you making two calls to printf for? also you formating is returning the length of the text computer. Computer is 8 characters long. when using printf you need to use a format that goes with your data type. Your using decimal %d instead of string %s and making an additional call to printf as well. Try this

Code: C
#include<stdio.h>
void main()
{
printf("%s","Computer");
}

additionally you need to use some sort of debugger or make a scanf reference to see the output.

Code: C
#include<stdio.h>
void main()
{
printf("%s","Computer");
char i = scanf("i");
}

in practice you don't call scanf like that(without formatting) but it will exit the program one you press enter allowing you to check the output. I'd say use system("PAUSE"); but that is windows only.