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

Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

0 Answers   iGate,


solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)

0 Answers  


U hv to enter a range from a and b and search hw many no. of times a pattern n. occurs between the range a and b. Eg :i/p:enter range :0 100 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 0 to 100:1 Eg :i/p:enter range :100 1000 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 100 to 1000: (in this 13,113,131,132,133&#8230;139,213,313,&#8230;913 all these will be counted)

0 Answers  


write a program to calculate the radius for a quadratic equation use modular programming(function abitraction)hint use quadratic function

1 Answers   ICAN, Jomo Kenyatta University,


How do I store linked list datas into an array?

1 Answers  






Display Pattern: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 &#8230;

2 Answers   Mind Tree,


Write code for the multiplication of COMPLEX numbers?

0 Answers   IBM,


Write an algorithm that receives a string and reverses it.

2 Answers  


#include<iostream.h> //main() //{ class A { friend class B; public: void read(); }; class B { public : int a,b; }; void A::read() { cout<<"welcome"; } main() { A x; B y; y.read(); } In the above program......, as B is a friend of A B can have access to all members,i cant access y.read . could you please tell me the reason and what would i code to execute this program?

2 Answers  


i don't know about working of nested for loop can any one help me

0 Answers  


Code for Easily Using Hash Table?

0 Answers  


main(){int a=5,b 10,c=2, d;a=b c;d=++a=(--c)*2; printf("%d%d%d%d,a,b,c,d; return o;}

1 Answers  


Categories