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)

1) Which header file is required to run this program?

#include <.....>
int main()
{
cout<
  1. stdio.h

  2. conio.h

  3. iostream.h

  4. ostream.h

Answer
 
Correct Answer - 3

iostream.h

1)运行该程序需要哪个头文件?
2) Which is the correct statement to print the value of age?

#include <iostream.h>
int main()
{
int age=19;
.....
return 0;
}

  1. cout << "Age: %d",age;

  2. cout << "Age: %d" << age;

  3. cout << "Age: " + age;

  4. cout << "Age: " << age;

Answer
Correct Answer - 4

cout << "Age: " << age;

2)哪个是打印age值的正确语句?

  1. cout <<“年龄:%d”,年龄;

  2. cout <<“ Age:%d” <<年龄;

  3. cout <<“ Age:” + age;

  4. cout <<“ Age:” <<年龄;

回答
正确答案-4

cout <<“ Age:” <<年龄;

3) What will be the output of following program?

#include <iostream.h>
int a=10;
int main()
{
int a=20;
cout<<::a return>
  1. 10

  2. 20

  3. ::10

  4. ::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.

3)以下程序的输出是什么?
.minHeight{ min-height: 250px; } @media (min-width: 1025px){ .minHeight{ min-height: 90px; } } .minHeight{ min-height: 250px; } @media (min-width: 1025px){ .minHeight{ min-height: 90px; } }
4) Which is the correct answer regarding '\n' and endl?

  1. Both are same.

  2. '\n' and endl both are used to print new line but endl flushes the buffer after printing new line.

  3. '\n' and endl both are used to print new line but '\n' flushes the buffer after printing new line.

  4. '\n' used in C programming while endl used in C++ programming.

Answer
Correct Answer - 2

'\n' and endl both are used to print new line but endl flushes the buffer after printing new line.

4)关于'\ n'endl的正确答案是什么?

  1. 两者都一样。

  2. '\ n'endl都用于打印新行,但是endl在打印新行后刷新缓冲区。

  3. '\ n'endl都用于打印新行,但是'\ n'在打印新行后刷新缓冲区。

  4. '\ n'用于C编程,而endl用于C ++编程。

回答
正确答案-2

'\ n'endl都用于打印新行,但是endl在打印新行后刷新缓冲区。

5) Which header file is required to use setw() function?

  1. conio.h

  2. iostream.h

  3. stdlib.h

  4. iomanip.h

Answer
Correct Answer - 4

iomanip.h
setw() is a manipulator and it is declared in iomanip.h header file.

5)使用setw()函数需要哪个头文件?

  1. conio.h

  2. iostream.h

  3. 标准库

  4. iomanip.h

回答
正确答案-4

iomanip.h
setw()是一个操纵器,它在iomanip.h头文件中声明。

6) Why setw() is used?

  1. To set width of the variable in memory.

  2. To pad the value with space or any defined special character of next variable.

  3. To set the white spaces in the input buffer.

  4. None of these.

Answer
Correct Answer - 2

To pad the value with space or any defined special character of next variable.

6)为什么要使用setw()

  1. 设置内存中变量的宽度。

  2. 用空格或下一个变量的任何已定义特殊字符填充值。

  3. 设置输入缓冲区中的空白。

  4. 都不是。

回答
正确答案-2

用空格或下一个变量的任何已定义特殊字符填充值。

7) What will be the output of following programs?

#include >iostream>
using namespace std;
int main()
{
cout <<P"includehelp.com";
return 0;
}

  1. Compile Time Error

  2. Run Time Error

  3. includehelp.com

  4. None of these.

Answer
Correct Answer - 1

Compile Time Error

7)以下程序的输出是什么?

#include >iostream>
using namespace std;
int main()
{
cout <<P"includehelp.com";
return 0;
}

  1. 编译时错误

  2. 运行时错误

  3. includehelp.com

  4. 都不是。

回答
正确答案-1

编译时错误

翻译自: https://www.includehelp.com/cpp-programming/basic-aptitude-questions-and-answers.aspx

c语言编程输入a是输出为a

c语言编程输入a是输出为a_C ++编程基本输入,输出,数据类型,声明能力倾向问题和解答...相关推荐

  1. java语言编程三角形图形_编程题:编写程序输入三角形的3条边长,计算并输出... 求助一道JAVA编程题:编写一个类似记事本的图形用......

    导航:网站首页 > 编程题:编写程序输入三角形的3条边长,计算并输出... 求助一道JAVA编程题:编写一个类似记事本的图形用... 编程题:编写程序输入三角形的3条边长,计算并输出... 求助 ...

  2. 【C语言】从键盘任意输入一个3位整数,编程计算并输出它的逆序数(忽略整数前的正负号)。

    C语言实战题目:从键盘任意输入一个3位整数,编程计算并输出它的逆序数(忽略整数前的正负号).例如,输入-123,则忽略负号,由123分离出其百位1.十位2.个位3,然后计算3*100+2*10+1 = ...

  3. 【C语言入门】假设银行定期存款的年利率 r 为 2.25 % ,从键盘输入本金和存款年限,编程计算并输出该笔存款到期后的本金和利息一共有多少。

    题目:假设银行定期存款的年利率 r 为 2.25 % ,从键盘输入本金和存款年限,编程计算并输出 该笔存款到期后的本金和利息一共有多少. (例如:当本金为 1000 元,存入 10 后,应得的本金与利 ...

  4. a除以b的编程怎么写C语言,输入a,b两个整数,编程求出a除以b得到的商和余数.c语言...

    C语言编程问题 编程任意输入两个实数a和b,计算下面函数的值,并输出y值. a-b a>b y= a/b a #includevoidmain(){\x09floata,b,y;\x09prin ...

  5. python输入123输出321的编程_第2章 Python编程基础知识 第2.1节 简单的Python数据类型、变量赋值及输入输出...

    第三节 简单的Python数据类型.变量赋值及输入输出 Python是一门解释性语言,它的执行依赖于Python提供的执行环境,前面一章介绍了Python环境安装.WINDOWS系列Python编辑和 ...

  6. ​用c语言打印自定义的乘法口诀表。例如:输入9,输出9*9口诀表,输入12,输出12*12的乘法口诀表。...

    用c语言打印自定义的乘法口诀表.例如:输入9,输出9*9口诀表,输入12,输出12*12的乘法口诀表. #include <stdio.h> int main () { int n; in ...

  7. c语言程序输入n个数字排序,请问,C语言能人请进,用写一个程序,要求输入N个整数,按从小到大的顺序输出,就说说...

    导航:网站首页 > 请问,C语言能人请进,用写一个程序,要求输入N个整数,按从小到大的顺序输出,就说说 时间:2016-12-18 用写一个程序,要求输入N个整数,按从小到大的顺序输出,就说说思 ...

  8. java输入长和宽输出面积_JAVA根据用户输入的长和宽,编程求长方形的面积和周长....

    题目: JAVA根据用户输入的长和宽,编程求长方形的面积和周长. 根据用户输入的长和宽,编程求长方形的面积和周长. 分析: 1) 新建控制台项目,名为Ex2_1,修改类的名字为Rectangle. 2 ...

  9. c语言 输入1-7之间的一个整数,然后根据输入的数字判断是星期几,最后输出对应的星期的全称。如输入3,则输出Wednesday。

    4.输入1-7之间的一个整数,然后根据输入的数字判断是星期几,最后输出对应的星期的全称.如输入3,则输出Wednesday. C语言## ## c输入1-7之间的一个整数,然后根据输入的数字判断是星期 ...

最新文章

  1. 基于Dijkstra算法的武汉地铁路径规划!
  2. 内核驱动模块Makfle
  3. silverlight turntable
  4. mysql的原理图解_MySQL排序工作原理
  5. android 重叠view 重叠布局,按比例布局
  6. 查看本机ssh公钥,生成公钥
  7. 【LeetCode笔记】200. 岛屿数量(Java、DFS)
  8. 7z001怎么解压在安卓手机上面_安卓zip文件压缩RAR解压手机下载-安卓zip文件压缩RAR解压v1.0最新版下载...
  9. 上海市XXX区信息委门户网站集成项目总结
  10. Junit单元测试——如何正确测试异常
  11. w10恢复出厂设置_w10电脑恢复出厂设置 w10电脑恢复出厂设置的方法
  12. 同比 数据模型 环比_使用数据分析软件进行同比和环比数据分析
  13. 红罐王老吉品牌定位战略
  14. ArcServer 9.3 ecp、 ArcSDE 9.3 ecp、 ArcIMS 9.3 ecp、 ArcEngine 9.3 ecp
  15. 数学与计算机科学虎扑,数学发展到今天还有继续研究的必要吗?
  16. 未来计算机畅想英语作文,畅想未来的生活life in the future
  17. 【数据库】车牌识别数据库(CCPD数据集)
  18. Mixly16:震动报警器
  19. modelnet40介绍_三维形状数据的深度特征表示
  20. 常见的抓包检测及抓包方案

热门文章

  1. Qt图形界面编程入门(创建一个简单的程序)
  2. python多线程输出_萌新python多线程
  3. Linux 服务器停止当前运行的程序,实验,代码
  4. Python网络请求库Requests,妈妈再也不会担心我的网络请求了(二)
  5. linux I/O 栈 预习(上)
  6. 将不确定变为确定~头压缩是否有必要,MVC如何实现头压缩
  7. 简述container与container-fluid的区别
  8. ES6特性之:Spread操作符
  9. 后台拿webshell的常用方法总结
  10. Ubuntu 找不到libc.so.6