how to write a cprogram yo get output in the form
*
***
*****
*******
*********
*******
*****
***
*
Answer Posted / arka bandyopadhyay
#include<stdio.h>
#include<conio.h>
void main()
{ int i,j,k,a=4;
k=1;
clrscr();
printf("\n");
for(i=8;i>=0;i--)
{
for(j=0;j<=8 ;j++)
{
if(i>=4)
{
if(j<a ||j>(9-a-1) )
printf(" ");
else
printf(" *");
}
else
{
if(j>(8-k)||j< k)
printf(" ");
else
printf(" *");
}
}
--a;
if(i<4)k++;
printf("\n");
}
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
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 mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
write a c program in such a way that if we enter the today date the output should be next day's date.
What does *p++ do?
Explain how can I convert a number to a string?
How do I swap bytes?
Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers
what are non standard function in c
Where we use clrscr in c?
What is string constants?
How is pointer initialized in c?
how to print the character with maximum occurence and print that number of occurence too in a string given ?
Why static variable is used in c?
What are variables and it what way is it different from constants?
Why do we use return in c?