c语言编程输入a是输出为a
This section contains C++ programming Basic Input, Output, Data types, Declaration etc Aptitude Questions and Answers with explanations.
本节包含C ++编程的基本输入,输出,数据类型,声明等,以及有关解释的能力问题和解答。
C ++编程基本能力问题列表 (List of C++ programming basic Aptitude Questions and Answers)
#include <.....>
int main()
{
cout<stdio.h
conio.h
iostream.h
ostream.h
Answer Correct Answer - 3
iostream.h
#include <iostream.h>
int main()
{
int age=19;
.....
return 0;
}
cout << "Age: %d",age;
cout << "Age: %d" << age;
cout << "Age: " + age;
cout << "Age: " << age;
cout << "Age: " << age;
cout <<“年龄:%d”,年龄;
cout <<“ Age:%d” <<年龄;
cout <<“ Age:” + age;
cout <<“ Age:” <<年龄;
cout <<“ Age:” <<年龄;
#include <iostream.h>
int a=10;
int main()
{
int a=20;
cout<<::a return>10
20
::10
::20
Answer Correct Answer - 1
10
:: is a Scope Resolution Operator, it is used to access the value of global variable and ::a will return the value of global declared variable.
Both are same.
'\n' and endl both are used to print new line but endl flushes the buffer after printing new line.
'\n' and endl both are used to print new line but '\n' flushes the buffer after printing new line.
'\n' used in C programming while endl used in C++ programming.
'\n' and endl both are used to print new line but endl flushes the buffer after printing new line.
两者都一样。
'\ n'和endl都用于打印新行,但是endl在打印新行后刷新缓冲区。
'\ n'和endl都用于打印新行,但是'\ n'在打印新行后刷新缓冲区。
'\ n'用于C编程,而endl用于C ++编程。
'\ n'和endl都用于打印新行,但是endl在打印新行后刷新缓冲区。
conio.h
iostream.h
stdlib.h
iomanip.h
iomanip.h
setw() is a manipulator and it is declared in iomanip.h header file.
conio.h
iostream.h
标准库
iomanip.h
iomanip.h
setw()是一个操纵器,它在iomanip.h头文件中声明。
To set width of the variable in memory.
To pad the value with space or any defined special character of next variable.
To set the white spaces in the input buffer.
None of these.
To pad the value with space or any defined special character of next variable.
设置内存中变量的宽度。
用空格或下一个变量的任何已定义特殊字符填充值。
设置输入缓冲区中的空白。
都不是。
用空格或下一个变量的任何已定义特殊字符填充值。
#include >iostream>
using namespace std;
int main()
{
cout <<P"includehelp.com";
return 0;
}
Compile Time Error
Run Time Error
includehelp.com
None of these.
Compile Time Error
#include >iostream>
using namespace std;
int main()
{
cout <<P"includehelp.com";
return 0;
}
编译时错误
运行时错误
includehelp.com
都不是。
编译时错误
翻译自: https://www.includehelp.com/cpp-programming/basic-aptitude-questions-and-answers.aspx
c语言编程输入a是输出为a