a simple c program using 'for' loop to display the output
5
4
3
2
1
Answer Posted / rohit dilip kakade
#include<stdio.h>
#include<conio.h>
void main(void)
{
int i;
clrscr();
for(i=5;i>0;i--)
{
printf("
%d",i);
}
getch();
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is structure in c definition?
Explain the difference between exit() and _exit() function?
What is difference between far and near pointers?
Are the variables argc and argv are local to main?
What is the purpose of macro in C language?
What is the difference between NULL and NUL?
What are enumerated types?
What is a memory leak? How to avoid it?
Differentiate between a structure and a union.
What is the difference between text and binary modes?
Is c object oriented?
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
What are the storage classes in C?
Explain the use of keyword 'register' with respect to variables.
What is assignment operator?