Answer Posted / manojkumar challagundla
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
int ctr=1;
for(i=1;i<=4;i++)
{
printf("\n")
for(j=1;j<=i;j++)
{
printf("%d",ctr);
ctr++;
}
}
}
| Is This Answer Correct ? | 2 Yes | 4 No |
Post New Answer View All Answers
Write a program to print fibonacci series using recursion?
What is volatile c?
What are the advantages and disadvantages of a heap?
What is the use of bitwise operator?
Why we use conio h in c?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
how should functions be apportioned among source files?
What is the difference between exit() and _exit() function?
Do pointers take up memory?
Why c is a procedural language?
What do you understand by normalization of pointers?
When we use void main and int main?
You have given 2 array. You need to find whether they will
create the same BST or not.
For example:
Array1:10 5 20 15 30
Array2:10 20 15 30 5
Result: True
Array1:10 5 20 15 30
Array2:10 15 20 30 5
Result: False
One Approach is Pretty Clear by creating BST O(nlogn) then
checking two tree for identical O(N) overall O(nlogn) ..we
need there exist O(N) Time & O(1) Space also without extra
space .Algorithm ??
DevoCoder
guest
Posted 3 months ago #
#define true 1
#define false 0
int check(int a1[],int a2[],int n1,int n2)
{
int i;
//n1 size of array a1[] and n2 size of a2[]
if(n1!=n2) return false;
//n1 and n2 must be same
for(i=0;i
Here is a neat trick for checking whether two strings are equal
I need a sort of an approximate strcmp routine?