code snippet for creating a pyramids triangle
ex
1
2 2
3 3 3
Answers were Sorted based on User's Feedback
Answer / vignesh1988i
A SMALL IMPLEMENTATION OF POINTERS
#include<stdio.h>
#include<conio.h>
void main()
{
int n,*p,*q;
printf("enter the number of lines :");
scanf("%d",&n);
for(int i=1,p=&i;*p<=n;*p++)
{
printf("\n");
for(int j=1,q=&j;*q<=*p;*q++)
{
printf("%d",*p);
printf(" ");
}
}
getch();
}
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / manvi
main()
{
int i,j,n;
printf("enter the limit");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=0;j<i;j++)
{
printf("%d",i);
}
printf("\n");
}
}
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / k
#include<iostream.h>
int main()
{int i,j,k;
for(i=1;i<=3;i++)
{cout<<"\n";
for(j=1;j<=3-i;j++)
cout<<" ";
for(k=i;k>0;k--)
cout<<i<<" ";
}
return 0;
}
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / rajesh kamar s
void main()
{
int n,i,j;
printf("enter the num of rows\t:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(int k=0;k<n-i;k++)
printf(" ");
for(j=1;j<=i;j++)
printf("%d ",i);
printf("\n");
}
}
Is This Answer Correct ? | 1 Yes | 2 No |
write a c program to find the square of a 5 digit number and print the result.
5 Answers Accenture, Sasken, Vimukti Technologies,
Why static is used in c?
program to find the roots of a quardratic equation
Do you know the use of 'auto' keyword?
What is a sequential access file?
When is an interface "good"?
WHAT WILL BE OUTPUT OF BELOW CODE . . AND PLEASE EXPLAIN HOW IT COME .. #include<stdio.h> #include<conio.h> void main() { int k=20; printf("%d%d%d%d",k,k++,++k,k); getch(); }
fn f(x) { if(x<=0) return; else f(x-1)+x; }
write C code to reverse a string such that if i/p is "abc defg hij klmno pqrs tuv wxyz" and the o/p should be "cba gfed jih onmlk srqp vut zyxw"
what is the use of call back function in c?tell me with example
What is header file definition?
The code is::::: if(condition) Printf("Hello"); Else Printf("World"); What will be the condition in if in such a way that both Hello and world are printed in a single attempt?????? Single Attempt in the sense... It must first print "Hello" and it Must go to else part and print "World"..... No loops, Recursion are allowed........................
14 Answers HOV Services, IBM, Potty,