Ⅰ Report#1
Report#1 printf() /* Program : hello.c Student-ID : 095740C Author UpDate Comment */ #include<stdio.h> int main(){ : Yuhi,TOMARI : 2009/04/28(Thu) : Used Easy Function printf() 10 printf("hello, C World!\n"); 11 return(0); 12} a.out yuuhi-tomari-no-macbook:sample e095740$./a.out Hello, C World! 1 /**/ #include C #include(stdio.h) stdio.h STanDard Input and Output Header= {} main 10printfprintf ( )
11 11return(0); OS= C; h 2,PP.50()
#include<stdio.h> int main(){ printf("hello,\n"); printf("c World\n"); printf("nice to meet you\t"); printf("c World\n"); return(0); }
[] Hello,C World"
[] Hello,C World\ [] Hello,C World!
a. "Hello, C World! n""goodbye,c World! n" 1/* 2 program:hello.c 3 Student-ID:095740C 4 Author:TOMARI,Yuhi 5 UpDate:2009/04/28(Thu) 6 Comment:1stReport 7 */ 8 #include<stdio.h> 9 int main(){ 10 printf("goodbye,cworld\n"); 11 return(0); 12 } a.out yuuhi-tomari-no-macbook:a e095740$./a.out GoodBye,Cworld printf("...")"hello, C World!\n" Hello,C World f(x) f printf"" ""
printf b. [] (i) 2 int main (){ 3 printf("goodbye,cworld\ngoodbye,cworld\ngoodbye,cworld \n"); 4 return(0); 5} (ii) 1#include<stdio.h> 2int main (){ 3 printf("goodbye,cworld\n"); 4 printf("goodbye,cworld\n"); 5 printf("goodbye,cworld\n"); 6 return(0); 7} Report-1.outReport-2.out ( i ) yuuhi-tomari-no-macbook:b e095740$./report-1.out GoodBye,Cworld GoodBye,Cworld GoodBye,Cworld (ii) yuuhi-tomari-no-macbook:b e095740$./report-2.out GoodBye,Cworld GoodBye,Cworld GoodBye,Cworld ( i ) printf(ⅰ)"goodbye,cworld\n" (ii) printf( )"GoodBye,Cworld\n"
b (ii) ( i )printf(); printf(); (ii) ii c. Hello,C World! b-(ii) 1#include<stdio.h> 2int main(){ 3 printf("hello, n"); 4 printf("c World n") 5 return(0); 6} a.out yuuhi-tomari-no-macbook:c e095740$./a.out Hello, C World b-(ii) b-(ii)a
d.printf("...") printf("... n") [] ( i )printf("...") 2 int main(){ 3 printf("hello, C World"); 4 return(0); 5} (ii)printf("... n") 2 int main(){ 3 printf("hello, C World!\n"); 4 return(0); 5} Report.outReport-2.out ( i ) Hello, C Worldyuuhi-tomari-no-macbook:d e095740$_ (ii) Hello, C World! yuuhi-tomari-no-macbook:d e095740$ printf("...") printf("... n") n n
n e.3 ( i ) (ii) [] ( i ) 2 int main(){ 3 printf("hello, C World! Hello, C World! Hello, C World \n"); 4 return(0); 5} (ii) 2 int main(){ 3 printf("hello,c World!"); 4 printf("hello,c World!"); 5 printf("hello,c World!\n"); 6 return(0); 7 } a.out Hello,C World!Hello,C World!Hello,C World! b n b b be c
f. ( * ) * *** ***** *** * [] 2 int main(){ 3 printf(" *\n"); 4 printf(" ***\n"); 5 printf("*****\n"); 6 printf(" ***\n"); 7 printf(" *\n"); 8 return(0); 9 } a.out yuuhi-tomari-no-macbook:f e095740$./a.out * *** ***** *** * 5 e e
g. * [] 2 int main(){ 3 printf("** ** **\n"); 4 printf(" ** ** **\n"); 5 printf(" ******\n"); 6 printf(" ********\n"); 7 printf(" ******\n"); 8 printf(" ** ** **\n"); 9 printf("** ** **\n"); 10 return(0); 11 } a.out yuuhi-tomari-no-macbook:g e095740$./a.out ** ** ** ** ** ** ****** ******** ****** ** ** ** ** ** ** f f h. [1] 2 int main (){ 3 prontf("goodbye,cworld\n"); 4 return(0); 5} -13-
[1] Undefined symbols: "_prontf", referenced from: _main in cchgyk9m.o ld: symbol(s) not found collect2: ld returned 1 exit status [2] 1#include<stdio.h> 2int main (){ 3 printf("goodbye,cworld\n") 4 printf("goodbye,cworld\n") 5 printf("goodbye,cworld\n") 6 return(0) 7 } [2] yuuhi-tomari-no-macbook:~ e095740$ cc Report.c Report.c: In function main : Report.c:4: error: syntax error before printf [] 2 int main (){ 3 printf("goodbye,cworld\ngoodbye,cworld\ngoodbye,cworld \n"); 4 return(0); 5} [] ld warning: in Report, file is not of required architecture Undefined symbols: "_main", referenced from: start in crt1.10.5.o ld: symbol(s) not found collect2: ld returned 1 exit status #include<stdio.h> int main(){ printf("hello,\n"); printf("c World\n"); printf("nice to meet you\n\r"); return(0); } -14-
[] escape.c: In function main : escape.c:4: error: stray \227 in program escape.c:4: error: stray \128 in program escape.c:4: error: stray \128 in program escape.c:4: error: stray \227 in program escape.c:4: error: stray \128 in program escape.c:4: error: stray \128 in program yuuhi-tomari-no-macbook:~ e095740$ "_prontf"printf prontf 24 ; ;.c error error
C http://c-production.com/contents/c/sec09.html -16-