Display Pattern:
1
2 3
4 5 6 7
8 9 10 11 12 13 14 15
…

Answers were Sorted based on User's Feedback



Display Pattern: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 … ..

Answer / yana

listing program c++ 1,1,3,2,5,7,3,9,11,4,13,15

Is This Answer Correct ?    2 Yes 3 No

Display Pattern: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 … ..

Answer / gowtham

#include<stdio.h>
#include<conio.h>
main()
{
int n,i,s=0;
clrscr();
printf("Enter n value:");
scanf("%d",&n);
for(i=0;i<=8230;i++)
{
s=s+1;
}
printf("%d",s);
getch();
}

Is This Answer Correct ?    3 Yes 10 No

Post New Answer

More C++ Code Interview Questions

Code for Two Classes for Doing Gzip in Memory?

0 Answers  


what is virtual constroctor ? give an exam for it?-(parimal dhimmar)

2 Answers  


using repetition structure. Write a c program that will accept five numbers. The program should count and output the total count of even numbers and total count of add numbers.

2 Answers  


Teta-Omeg-Big-Oh Show that f(n) = n2 + 3n3 is ;(n3).

0 Answers   Qatar University,


Min-Max Write an algorithm that finds both the smallest and largest numbers in a list of n numbers and calculate its complexity T(n).

1 Answers   Infosys, Qatar University,






Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.

5 Answers   ADP, Amazon, HCL, IBM, Infosys, Satyam, TCS, Vimukti Technologies,


What output does the following code generate? Why? What output does it generate if you make A::Foo() a pure virtual function? class A { A() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; class B : public A { B() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; int main(int, char**) { A objectA; B objectB; return 0; }

0 Answers  


. Remove all the blank spaces between character.Matrix is of 10* 10. eg: INPUT ------------------------------------ | N | A | | V | |T ------------------------------------- | |G | U | |P | -------------------------------------- |T | | | A | | ------------------------------------ OUTPUT: ------------------------------------ | N | A | V | T | | ------------------------------------- |G |U | P | | | -------------------------------------- |T | A | | | | ------------------------------------

2 Answers   Nagarro,


Write a program using two-dimensional arrays that determines the highest and lowest of the 12 input values. Example: Enter 12 numbers: 13 15 20 13 35 40 16 18 20 18 20 14 highest: 40 lowest: 13

1 Answers  


Assume in University Every student in university as entity, prepare a class for student that store the roll no, name, dob of student, and make funtion of deletion, manipulation, addition of student record.

0 Answers  


write a program to convert temperature from fa height into celcius and vise versa,use modular programming

0 Answers   Jomo Kenyatta University,


how to find out the maximum number out of the three inputs.

6 Answers   ABC, Apple, C3I, HP, TCS,


Categories