Write a program that his output * *** *****

Answer Posted / srujitha

int main()
{
int n = 5;

for( int i = 0; i <= n; i = i + 2)
{
for( int j = 0; j<=i;j++)
{
printf("*");
}
printf(" ");
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you pass an array to a function by value?

611


Why is it usually a bad idea to use gets()? Suggest a workaround.

917


Are global variables static in c?

681


If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?

784


I need testPalindrome and removeSpace #include #define SIZE 256 /* function prototype */ /* test if the chars in the range of [left, right] of array is a palindrome */ int testPalindrome( char array[], int left, int right ); /* remove the space in the src array and copy it over to the "copy" array */ /* set the number of chars in the "copy" array to the location that cnt points t */ void removeSpace(char src[], char copy[], int *cnt); int main( void ) { char c; /* temporarily holds keyboard input */ char string[ SIZE ]; /* original string */ char copy[ SIZE ]; /* copy of string without spaces */ int count = 0; /* length of string */ int copyCount; /* length of copy */ printf( "Enter a sentence:\n" ); /* get sentence to test from user */ while ( ( c = getchar() ) != '\n' && count < SIZE ) { string[ count++ ] = c; } /* end while */ string[ count ] = '\0'; /* terminate string */ /* make a copy of string without spaces */ removeSpace(string, copy, ©Count); /* print whether or not the sentence is a palindrome */ if ( testPalindrome( copy, 0, copyCount - 1 ) ) { printf( "\"%s\" is a palindrome\n", string ); } /* end if */ else { printf( "\"%s\" is not a palindrome\n", string ); } /* end else */ return 0; /* indicate successful termination */ } /* end main */ void removeSpace(char src[], char copy[], int *cnt) { } int testPalindrome( char array[], int left, int right ) { }

2220






What is scope rule of function in c?

556


Are comments included during the compilation stage and placed in the EXE file as well?

674


program to convert a integer to string in c language'

1990


I heard that you have to include stdio.h before calling printf. Why?

594


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

636


What is difference between structure and union?

606


Does sprintf put null character?

607


How is a macro different from a function?

661


What are the storage classes in C?

631


Is array a primitive data type in c?

585