Re: for and arrays
- From: "Bill Cunningham" <nospam@xxxxxxxxx>
- Date: Thu, 24 Jul 2008 19:59:49 GMT
"Mark L Pappin" <mlp@xxxxxxx> wrote in message
news:87bq0odu4m.fsf@xxxxxxxxxxxxxxxxxxx
[snip]
1. Copy and paste this code (between "/*begin1*/" and "/*end1*/") into
a new source file, compile, and run it. What output does it produce?
/*begin1*/
#include <stdio.h>
int main(void){
/* you are not expected to understand this - it is to
verify that you can and will follow instructions */
printf("%s%c%d\n",
"protest"+3,
"blank space"[5],
27/3-2*2*2);
return 0;
}
/*end1*/
2. Write a program to print a single line containing the greeting
"Hello, world!" followed by a newline character.
The results I got from your first program was a warning concerning no
newline character and the text
test 1
Here is the answer to #2 of your question.
#include <stdio.h>
int main(void) {
printf("hello world\n");
return 0;
}
Do you wish to correspond through private email ? I will post the answer to
your third question later.
Bill
.
- Follow-Ups:
- Re: for and arrays
- From: Bill Cunningham
- Re: for and arrays
- References:
- for and arrays
- From: Bill Cunningham
- Re: for and arrays
- From: Ben Bacarisse
- Re: for and arrays
- From: Bill Cunningham
- Re: for and arrays
- From: Ben Bacarisse
- Re: for and arrays
- From: Bill Cunningham
- for and arrays
- Prev by Date: debugging a seg fault
- Next by Date: Re: for and arrays
- Previous by thread: Re: for and arrays
- Next by thread: Re: for and arrays
- Index(es):
Relevant Pages
|