A PHP Error was encountered

Severity: Warning

Message: fopen(/var/cpanel/php/sessions/ea-php56/PHPSESSIDt10jfcbu25rvgi1mvbgf41fb7k1rqdfu): failed to open stream: No space left on device

Filename: drivers/Session_files_driver.php

Line Number: 174

pattern program 5 (C language)
Q:

pattern program 5 (C language)

0

pattern program 5

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program - 5

/*C program to print following Pyramid:
    **********
    ****  ****
    ***    ***
    **      **
    *        *
*/

#include<stdio.h>

#define MAX	5

int main()
{
	int i,j;
	int space=0;
	/*run loop (parent loop) till number of rows*/
	for(i=MAX;i>0;i--)
	{
		/*print first set of stars*/
		for(j=0;j< i;j++)
		{
			printf("*");
		}
		for(j=0;j< space;j++)
		{
			printf(" ");
		}
		/*print second set of stars*/
		for(j=0;j< i;j++)
		{
			printf("*");
		}
		
		printf("\n");
		space+=2;
	}
    return 0;
}

Output

    **********
    ****  ****
    ***    ***
    **      **
    *        *

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now

A PHP Error was encountered

Severity: Warning

Message: Unknown: Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/var/cpanel/php/sessions/ea-php56)

Filename: Unknown

Line Number: 0