write a program that prints a pascal triangle based on the
user input(like how many stages) in an efficient time and
optimized code?
Answer Posted / abhinav
call this recursive routine:
void pascal(int n)
{
if(n==1) {
printf("%d \n", n);
return;
}
pascal(n-1);
int i;
for(i=1;i<=n; i++)
printf("%d ",i);
for(i=n-1;i>=1; i--)
printf("%d ",i);
printf("\n");
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the features of c languages?
What is the use of c language in real life?
What is the difference between exit() and _exit() function?
What is the basic structure of c?
write a proram to reverse the string using switch case?
What is the method to save data in stack data structure type?
What is calloc in c?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
What is the stack in c?
all c language question
Do you have any idea about the use of "auto" keyword?
Which programming language is best for getting job 2020?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
What is difference between arrays and pointers?
What are the usage of pointer in c?