• Result
  • Today's Puzzle
    • Previous Puzzles
    • Prize & Rules
  • Discussion Board
    • Suggestion Board
    • Trending Articles
  • Maths Tricks
  • Placement Papers
    • Placement Questions
    • Interview Experience
    • Placed user Comment
    • Group Discussion
  • English APP
  • login
  • Result
  • Today's Puzzle
    • Previous Puzzles
    • Prize & Rules
  • Discussion Board
    • Suggestion Board
    • Trending Articles
  • Maths Tricks
  • Placement Papers
    • Placement Questions
    • Interview Experience
    • Placed user Comment
    • Group Discussion
  • Walkins
    • Corporate Job Exam
    • Government Job Exam
    • Entrance Exam
  • Training
    • Internship
  • Placement Questions
  • /
  • C++

C++ interview questions and answers for freshers Page 2

C++ Select Another Category Select Another Topic

Programming and Technical

  • Android 118
  • ASP.NET 60
  • C 459
  • C++ 448
  • DATA STRUCTURE 66
  • DBMS 77
  • ELECTRONICS 39
  • Java 261
  • OOPs Concepts 117
  • Operating Syst 103
  • RDBMS 109
  • UNIX 70

C++ Question Topics

    Category (1)

    General Ability (4)

  • General Knowledge (2)
  • HR Interview (1)

  • Interview (1)
  • Logical Reasoning (5)

  • Blood Relations (3)
  • Coding Decoding (1)
  • General Mental Ability (1)
  • Numerical Ability (1)

  • Area and Volume (1)
  • Programming (67)

  • Basics (1)
  • Database (2)
  • Definition (16)
  • Program (14)
  • Technical (32)
  • Variables (1)
Keep an EYE (0)
Solved Question (1) UnSolved Question (447)
Pages: 45FirstPrev123456789NextLast
Advertisements

(#M40038436) C++ QUESTION What is the Output? Keep an EYE Keep an eye puzzle Keep an eye puzzle

class UseStatic {
static int a = 10;
static int b;
static void meth(int x) {
System.out.println("x = " + x);
System.out.println("a = " + a);
System.out.println("b = " + b);
}

public static void main(String args[]) {
UseStatic.meth(42);
}
static {
System.out.println("I am M4Math Geek");
b = a * 4;
}
}

Asked In C++ Alok Maurya (11 years ago)
Unsolved Read Solution (2)
Is this Puzzle helpful?   (8)   (0) Submit Your Solution Database

(#M40038181) C++ QUESTION Norvig Spellinbg Corrector Keep an EYE Keep an eye puzzle Keep an eye puzzle

What I wanted to do here is to develop, in less than a page of code, a toy spelling corrector that achieves 80 or 90% accuracy at a processing speed of at least 10 words per second.

So here, in 21 lines of Python 2.5 code, is the complete spelling corrector:

import re, collections

def words(text): return re.findall('[a-z]+', text.lower())

def train(features):
model = collections.defaultdict(lambda: 1)
for f in features:
model[f] += 1
return model

NWORDS = train(words(file('big.txt').read()))

alphabet = 'abcdefghijklmnopqrstuvwxyz'

def edits1(word):
splits = [(word[:i], word[i:]) for i in range(len(word) + 1)]
deletes = [a + b[1:] for a, b in splits if b]
transposes = [a + b[1] + b[0] + b[2:] for a, b in splits if len(b)>1]
replaces = [a + c + b[1:] for a, b in splits for c in alphabet if b]
inserts = [a + c + b for a, b in splits for c in alphabet]
return set(deletes + transposes + replaces + inserts)

def known_edits2(word):
return set(e2 for e1 in edits1(word) for e2 in edits1(e1) if e2 in NWORDS)

def known(words): return set(w for w in words if w in NWORDS)

def correct(word):
candidates = known([word]) or known(edits1(word)) or known_edits2(word) or [word]
return max(candidates, key=NWORDS.get)
The code defines the function correct, which takes a word as input and returns a likely correction of that word. For example:

>>> correct('speling')
'spelling'
>>> correct('korrecter')
'corrector'

Asked In C++ Pawan Pandey (11 years ago)
Unsolved
Is this Puzzle helpful?   (1)   (0) Submit Your Solution Program
Advertisements

(#M40037430) C++ QUESTION any puzzle Keep an EYE Keep an eye puzzle Keep an eye puzzle

What is implicit conversion/coercion in c++?

Asked In C++ Tharambigai ramesh (11 years ago)
Unsolved Read Solution (1)
Is this Puzzle helpful?   (2)   (1) Submit Your Solution Technical

(#M40037429) C++ QUESTION any puzzle Keep an EYE Keep an eye puzzle Keep an eye puzzle

Which of the following statements is incorrect?
A. Friend keyword can be used in the class to allow access to another class.
B. Friend keyword can be used for a function in the public section of a class.
C. Friend keyword can be used for a function in the private section of a class.
D. Friend keyword can be used on main().

Asked In C++ Tharambigai ramesh (11 years ago)
Unsolved Read Solution (4)
Is this Puzzle helpful?   (12)   (6) Submit Your Solution Technical

(#M40037428) C++ QUESTION any puzzle Keep an EYE Keep an eye puzzle Keep an eye puzzle

What do you mean by internal linking and external linking in c++?

Asked In C++ Tharambigai ramesh (11 years ago)
Unsolved Read Solution (2)
Is this Puzzle helpful?   (2)   (2) Submit Your Solution Technical

(#M40032442) C++ QUESTION Loops Keep an EYE Keep an eye puzzle Keep an eye puzzle

Generate random number

Asked In C++ Sachin kumar (11 years ago)
Unsolved Read Solution (3)
Is this Puzzle helpful?   (4)   (1) Submit Your Solution Program

(#M40031849) C++ QUESTION Keep an EYE Keep an eye puzzle Keep an eye puzzle

What will be the output for the following C++ program ..??

class Sample
{
public:
int *ptr;
Sample(int i)
{
ptr = new int(i);
}
~Sample()
{
delete ptr;
}
void PrintVal()
{
cout << "The value is " << *ptr;
}
};
void SomeFunc(Sample x)
{
cout << "Say i am in someFunc " << endl;
}
int main()
{
Sample s1= 10;
SomeFunc(s1);
s1.PrintVal();
}

Asked In C++ Rajendra Singh (11 years ago)
Unsolved Read Solution (4)
Is this Puzzle helpful?   (7)   (5) Submit Your Solution Program

(#M40031815) C++ QUESTION String and pointers Keep an EYE Keep an eye puzzle Keep an eye puzzle

Q. What is the difference between char a[] = “string”; and char *p =
“string”;?
In the first case 6 bytes are allocated to the variable a which is fixed,
where as in the second case if *p is assigned to some other value the
allocate memory can change.
What’s the

Asked In C++ padmapriya (11 years ago)
Unsolved Read Solution (1)
Is this Puzzle helpful?   (6)   (2) Submit Your Solution Definition

(#M40030317) C++ QUESTION C++ Keep an EYE Keep an eye puzzle Keep an eye puzzle

What is the difference between the functions memmove() and
memcpy()?

Asked In C++ MAN (11 years ago)
Unsolved Read Solution (3)
Is this Puzzle helpful?   (1)   (1) Submit Your Solution Technical

(#M40030316) C++ QUESTION C++ Keep an EYE Keep an eye puzzle Keep an eye puzzle

what are the types of file?

Asked In C++ MAN (11 years ago)
Unsolved Read Solution (1)
Is this Puzzle helpful?   (0)   (1) Submit Your Solution
Keep an EYE (0)
Solved Question (1) UnSolved Question (447)
Pages: 45FirstPrev123456789NextLast
  • Login
  • Register

Resend

Sponsored Links

Advertisements

Challenger of the Day

no image
Dimple
India
Punjab
Time: 00:01:33
Points
19

Maths Quotes

Arithmetic is where numbers fly like pigeons in and out of your head.

Carl Sandburg

"Numbers have life ; they are not just symbols on paper"

Sushmitha

Placed User Comments

M4Math helped me a lot.

Vipul Chavan 5 years ago

Thanks m4 maths for helping to get placed in several companies.
I must recommend this website for placement preparations.

yash mittal 5 years ago

Now enjoy Offline Access of latest Question.

Get M4maths app to avail expert's solution and latest selected questions.

Download m4maths app now

  • 2533K+Registerd user
  • 1774K+Engineers
  • 759K+MBA Asprirant
  • 3K+Enginnering College
  • 250+Company Exam
  • 150K+Interview Questions
  • Site Links
  • Home
  • Result
  • Today's Puzzle
  • Discussion Board
  • Maths Tricks
  • Advertise with us
  • Contact Us
  • Useful Info
  • Maths Quotes
  • Previous Puzzles
  • Prize
  • Privacy Policy
  • Disclaimer and Copyright
  • Terms and Conditions
  • Sitemap
  • Placement papers
  • TCS Placement Paper
  • HCL Placement Paper
  • INFOSYS Placement Paper
  • IBM Placement Paper
  • SYNTEL Placement Paper
  • TECHNICAL Interview
  • HR Interview
All rights are reserved to @m4maths.com