>a>>b; return();} This program will generate a compiler error. The format specification is only required for printf, cout doesnot need the "%d %f" to pri. Will the program run successfully? main(){ int a=2.9; float b=9; cin>>"%d %f">>a>>b; return();} This program will generate a compiler error. The format specification is only required for printf, cout doesnot need the "%d %f" to pri . 1 members have posted answers.">
GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  C++
Go To First  |  Previous Question  |  Next Question 
 C++  |  Question 172 of 203    Print  
Will the program run successfully?
main()
{
int a=2.9;
float b=9;
cin>>"%d %f">>a>>b;
return();
}




  
Total Answers and Comments: 1 Last Update: July 22, 2008     Asked by: vishwanathpillay 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Kaushik_khatua
 
This program will generate a compiler error. The format specification is only required for printf, cout doesnot need the "%d %f" to print the variable values.

Above answer was rated as good by the following members:
vishwanathpillay, parameshh, j_l_larson
July 22, 2008 01:12:57   #1  
Kaushik_khatua Member Since: July 2008   Contribution: 3    

RE: Will the program run successfully?
This program will generate a compiler error. The format specification is only required for printf cout doesnot need the " d f" to print the variable values.
 
Is this answer useful? Yes | NoAnswer is useful 4   Answer is not useful 0Overall Rating: +4    

 Related Questions

 Classes and objects are separate but related concepts. Every object belongs to a class and every class contains one or more related objects.  Ø      A Class 
Latest Answer : Class is a combination of data member & member function where object is used for calling function In class we declare In object we call ...

Virtual destructors: If an object (with a non-virtual destructor) is destroyed explicitly by applying the delete operator to a base-class pointer to the object, the base-class destructor function (matching 
Latest Answer : Virtual constructor is not build-in C++ feature but it doesn't mean its not used by devs in code and in conversations. There are many other things that doesn't exist in particular language yet, people find ways around to solve it (SingleTon, Virtual Constructor, ...

Latest Answer : if the solution is needed for the unix platform. Then you can create a pthread at the bottom of the program, take the current process id of the parent and make it a deamon by using the standard unix calls like detach(), chdir().. etc. Check if the parent ...
Read Answers (3) | Asked by : suji

What will be output of the following code#includeusing namespace std;class abc{ public : void main() { cout
Read Answers (5) | Asked by : Avaited

Hey anybody help me to write code for this programwap which display year,month & day presents in a year for eg.1. no. is 14 print 2 weeks2. no is 90 print 3 months3. no is 365 print 1 yearuser can input any no
Read Answers (3) | Asked by : avingle

Latest Answer : include#includeusing namespace std;int main(){             fstream *obj = new fstream();             obj->open ("main.cpp"); ...
Read Answers (4) | Asked by : arup

Write a program to dynamically create a matrix( no of rows and columns wud be provided by user at run time). Then ask a user to input elements and the nprint those elements.

Suppose there is a txt file with following format:Student name Grades in subjectsX ABA+CDA+Y B+CAA+AAthere can be many students with there grades in various subjects. (number of subjects are unknown)Possible values of grade are: A, A+, B, B+, C, D now suppose the file gets corrupted and all '+' are replaced by 'A'Write a program to restore the file
Tags : Restore

Latest Answer : In LINUX environment one can use VALGRIND and MPATROL free tools to find out possible memory leaks in programs. ...
Read Answers (6) | Asked by : rusty_man

Write a program to concatenate two circular linked lists into a single circular list. 
Latest Answer : class node {public:  node(int n) : m_n(n) { m_pNext = this; }  ~node() {}  void SetNext( node* p ) { m_pNext = p; }  node* GetNext() const { return m_pNext; }  int GetData() const { return m_n; }  static ...


 Sponsored Links

 
Related Articles

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

How to develop compile and run a C program

The steps involved in building a C program are: 1. First program is created by using any text editor and the file is stored with extension as .c 2. Next the program is compiled. There are many compilers available like GNU C compiler called as gcc, Sun compiler, Borland compiler which is pop
 

SQL Programming

SQL Programming Overview Anybody who has done something for a long time has probably wanted to change how things work at some point or another. A worker at a mill might have found a more efficient way of cutting logs, or a mathematics teacher might have had a hand in changing a school’s al
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

WinRunner Programming Concepts

If you want to create WinRunner scripts that are highly efficient, there are important programming concepts that you will want to become familiar with. Understanding these concepts will provide you with a large number of key benefits. In addition to understanding these concepts, you must also learn
 

Programming Languages Certification

IT Certification programs have several options that will offer you the best knowledge.  By learning everything that you need to know about information technology you will be able to open new doors to your career and personal business desires.  IT Certification offers several vari
 

Neuro-linguistic Programming Methods

Neuro linguistic Programming Methods There are several methods used for performing Neuro linguistic Programming on an individual for obtaining insights into the psyche of the person in order to correct to modify certain patterns of behavior These techniques are also used for Neuro linguistic trainin
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

The Difficult Past of Neuro-linguistic programming

The Difficult Past of Neuro linguistic programming Neuro linguistic programming has had a rocky past with a number of lawsuits rivalry unsystematic development and intermittent progress During the 1980s the two founders separated after the lawsuit filed by Bandler Bandler went on to file several law
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape