code snippet for creating a pyramids triangle
ex
1
2 2
3 3 3
Answer Posted / 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 |
Post New Answer View All Answers
What is the difference between local variable and global variable in c?
Can a variable be both constant and volatile?
how to introdu5ce my self in serco
What is difference between class and structure?
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
Is there a way to jump out of a function or functions?
What is array of structure in c?
Is null always equal to 0(zero)?
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
What is an endless loop?
What is keyword with example?
What is #include stdlib h?
Explain what are the different data types in c?
What are the 5 organizational structures?
Which header file is essential for using strcmp function?