网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
对于如下C语言程序 int main() { printf("Hello World\n"); fork(); fork(); printf("Hello World\n"); } 在UNIX操作系统中正确编译链接后,其正确的运行结果为
A.共打印出2行Hello World
B.共打印出3行Hello World
C.共打印出4行Hello World
D.共打印出5行Hello World
参考答案
更多 “ 对于如下C语言程序 int main() { printf("Hello World\n"); fork(); fork(); printf("Hello World\n"); } 在UNIX操作系统中正确编译链接后,其正确的运行结果为A.共打印出2行Hello WorldB.共打印出3行Hello WorldC.共打印出4行Hello WorldD.共打印出5行Hello World ” 相关考题
考题
假设在UNIX操作系统环境下执行以下程序: main() { printf("Hello World\n"); fork(); printf("Hello World\n"); } 若程序正常运行,子进程创建成功,那么,屏幕上得到输出的有A.1个Hello WorldB.2个Hello WorldC.3个Hello WorldD.4个Hello World
考题
运行下面程序时,从键盘输入字母H,则输出结果是#includestdio.hmain(){ char ch;ch=getchar();switch(ch){case ′H′:printf("Hello!\n");case ′G′:printf("Good morning!\n");default:printf("Bye_Bye!\n");}}A.Hello!B.Hello! Good Moring!C.Hello! Good morning! Bye_Bye!D.Hello! Bye_Bye!
考题
请分析下列程序。 int main() { printf("This is in main program"); if(fork()==0) printf("I am in child process"); else printf("I am in parent process");} 程序正确运行后结果是A.This is in main program I am in child process I am in parent processB.This is in main program I am in child processC.This is in main program I am in parent processD.This is in main program I am in child process This is in main program I am in parent process
考题
对于如下C语言程序intmain(){printf(HelloWorld\n);fork();printf(HelloWorld\n);}在UNIX操作系统中正确编译链接后,其正确的运行结果是A.共打印出2行HelloWorldB.共打印出3行HelloWorldC.共打印出4行HelloWorldD.共打印出5行HelloWorld
考题
有以下程序: includemain(){ char str[][20]={"Hello","Beijing"},*p=str;printf("%
有以下程序: # include<string.h> main() { char str[][20]={"Hello","Beijing"},*p=str; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是 ______。A.0B.5C.7D.20
考题
分析下列程序。 int main() { printf("Hello") ; fork(); printf("Hello") ; fork(); printf("Hello") ; fork(); printf("Hello") ;} 不考虑其他因素,程序正常运行后共打印出多少个"Hello"?A.15B.11C.7D.4
考题
对于如下C语言程序 int main() { pid_t pid; int x=1; pid = fork(); if(pid==0) printf("I am the child process, x=%d\n", ++x); else printf("I am the parent process, x=%d\n", --x); } 在UNIX操作系统中正确编译链接后,其正确的运行结果是A.I am the child process, x=2B.I am the parent process, x=0C.I am the parent process, x=2D.I am the child process, x=0
考题
下列程序的输出结果是______。includeusing namespace std;int main() {char a []="He
下列程序的输出结果是______。 #include<iostream> using namespace std; int main() { char a []="Hello, World"; char *ptr=a; while (* ptr) { if(*ptr)= 'a' *ptr' <= 'z') cout << char(*ptr+'A'-'a'); else cout << *ptr; ptr++; } return 0; }A.HELLO,WORLDB.Hello,WorldC.hELLO, wORLDD.hello,world
考题
下列程序执行后的输出结果是______。A.helloB.helC.hloD.hlm void func1 (int i); void func2 (int i); char st[]="hello,friend!"; void func1(int i) { printf("%c",st[i]); if(i<3){ i+=2;func2(i); } } void func2 (int i) { printf("%c",st[i]); if(i<3){ i+=2;func1(i); } } main() { int i=0;func1(i);printf("\n");}
考题
有以下程序:includemain(){ char str[][20]={"Hello","Beijing"),*p=str[0];printf("
有以下程序: #include<string.h> main() { char str[][20]={"Hello","Beijing"),*p=str[0]; printf("%d\n",strlen(p+20)); } 程序运行后的输出结果是( )。A.0B.5C.7D.20
考题
有以下程序:includemain(){charstr[][20]={"Hello","Beijing"}*p=str;printf("%\n",s
有以下程序: #include <string.h> main() { char str[][20]={"Hello","Beijing"}*p=str; printf("%\n",strlen(p+20)); } 程序运行后的输出结果是A.0B.5C.7D.20
考题
有如下程序void func1(int st[],int i){ printf("%c",st[i]); if(i}void func2(int st[],int i){ printf("%c",st[i]); if(i}main(){ char st[ ]="hello,friend! "; int i=0;func1(st,i); printf("\n");}程序执行后输出的结果是A.hello B.hel C.hlo D.编译出错
考题
有以下程序#include stdio.hvoid func(int n){ int i;for(i=0;i=n;i++) printf(”*”);printf(”#”).}main( ){ func(3); printf(”???? ”); func(4); printf(”\n”); }程序运行后的输出结果是A)****#????***#B)***# ????*** *#C)**#????*****#D)****#????*****#
考题
运行下面程序时,从键盘输入字母H,则输出结果是includemain(){ char ch;ch=getchar();s
运行下面程序时,从键盘输入字母H,则输出结果是 #include<stdio.h> main() { char ch; ch=getchar(); switch(ch) { case 'H':printf("Hello!\n"); case 'G':printf("Good morning!\n"); default:printf("Bye_Bye!\n"); } }A.Hello!B.Hello! GoodMoring!C.Hello! Goodmorning! Bye_Bye!D.Hello! Bye_Bye!
考题
有下列程序void func1(int i);void func2(int i);char st[ ]="hello,friend! ";void func1(int i){ printf("%c",st[i]); if(i3){i+=2;func2(i);}}void func2(int i){ printf("%c",st[i]); if(i3){i+=2;func1(i);}}main(){ int i=0;func1(i); printf("\n");}执行后的输出结果是A.hello B.helC.hlo D.hlm
考题
以下程序的输出结果是( )。 char str[15]=”hello!”; printf(“%d\n”,strlen(str)); A.15
以下程序的输出结果是( )。 char str[15]=”hello!”; printf(“%d\n”,strlen(str));A.15B.14C.7D.6
考题
下列程序 void func1(int i); void func2(int i) char st[]="hello,friend!"; void funcl(int i) { printf("%c",st[i]); if(i<3){i+=2;func2(i);} } void func2(int i) { printf("%c",st[i]); if(i<3){i+=2;funcl(i);} } main() { int i=0;funcl(i);printf("\n");} 执行后的输出结果是( )A.helloB.helC.hloD.hlrn
考题
下面的程序各自独立,请问执行下面的四个TestMemory 函数各有什么样的结果?①void GetMemory(char * p){p = (char * )malloc(100);}void TestMemory (void){char *str = NULL;GetMemory (str);strcpy(str, "hello world");prinff(str);}② char * GetMemory (void){char p[ ] = "hello world";return p;}void TestMemory (void){char * str = NULL;str = GetMemory( );printf(str);}③void GetMemory(char * * p, int num){* p = (char * )malloc(num);}void TestMemory (void){char * str = NULL;GetMemory(str, 100);strcpy( str, "hello" );printf(sir);}④void TestMemory (void){char *str = (char * )malloe(100);strepy (str, "hello" );free ( str );if(str ! = NULL){strepy( str, "world" );printf(str);}}
考题
运行下面程序时,从键盘输入字母H,则输出结果是 main() { char ch; ch=getchar(); swimh(ch) {case'H':printf("Hello!\n"); case'G':printf("Good morning!\n"); default:printf("Bye_Bye!\n"); } }A.Hello!B.Hello! GoodMoring!C.Hello! Good moming! Bye_ye!D.Hello! Bye_ye!
考题
有如下程序:includemain(){ int n=9;while(n>6){n--;printf("%d",n);}}该程序的输出结
有如下程序: #include<stdio.h> main() { int n=9; while(n>6){n--;printf("%d",n);} } 该程序的输出结果是( )。A.987B.876C.8765D.9876
考题
下列程序的输出结果是()。includeusing namespace std;int main(){char a[]=""Hello,W
下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() { char a[]=""Hello,World"; char*ptr = a; while(*ptr) { if(*ptr>= 'a' *ptr<='z') cout<<char(*ptr+'A'-'a'); else cout<<*ptr; ptr++; } retur 0; }A.HELLO, WORLDB.Hello, WorldC.HELLO, worldD.hello, world
考题
向页面输出Hello World的JavaScript语句是( )。 A.printf(Hello WorldHello World的JavaScript语句是( )。A.printf(Hello World) B.document.write(Hello World)C.h4Hello World/h4 D.alert(Hello World)
考题
请教:2016计算机四级网络工程师高分突破试题单选题8如何解答?
假设在UNIX操作系统环境下执行以下程序:main(){printf(Hello World\n);fork();printf(Hello World\n);}若程序正常运行,子进程创建成功,那么,屏幕上得到输出的有A.1个Hello WorldB.2个Hello WorldC.3个Hello WorldD.4个Hello World
考题
UNIX操作系统中,fork()系统调用用于创建进程。仔细阅读、分析下列程序,假设程序正确运行并创建子进程成功,那么,输出到屏幕的正确结果是main() { pid_t pid; pid = fork(); if (pid = = 0) printf ("Hello World\n"); else if (pid >0) printf ("Hello World\n"); else printf ("Hello World\n"); }A.什么都没有B.1行Hello WorldC.2行Hello WorldD.3行Hello World
考题
对于如下C语言程序 int main() { printf("Hello World\n"); fork(); printf("Hello World\n"); } 在UNIX操作系统中正确编译链接后,其正确的运行结果是A.共打印出2行Hello WorldB.共打印出3行Hello WorldC.共打印出4行Hello WorldD.共打印出5行Hello World
考题
向页面输出“Hello World”的JavaScript语句是()。
A.printf("Hello World")
B.document.write("Hello World")
C.Hello World
D.alert("Hello World")
考题
使用Javascript语言在网页文档中直接输出“Hello World!”字符,应使用以下哪段代码()A、alert(“Hello World!");B、printf(“Hello World!");C、Document.write(“Hello World!");D、Response.write(“Hello World!");
热门标签
最新试卷