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 |
my name is nani i completed my b-tech in hyd now i want go for interveiw but i dont know the process of software field interveiws plz help me anyone how many rouds there n what rounds plz plz plz help me n where i can get these details
what will be the output: main(){char ch;int a=10;printf("%d",ch);}
36 Answers Accenture, TCS, Wipro,
please tell me the logic for this C program : INPUT (string):ABCD OUTPUT :BCDA CDAB DABC
What is output redirection?
write a c program to store and print name,address,roll.no of a student using structures?
What is a substring in c?
#include<stdio.h> #include<conio.h> void main() { int m=0111,n=20; printf("%d%d\n",m,n); getch(); }
Explain how do you generate random numbers in c?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
A array contains dissimilar element how can we count, and A array contains dissimilar element how can we store in another array with out repetition.
a=5 a=a++/++a
how to find a 5th bit is set in c program