write a program to display the numbers in the following
4 4
3 3
2 2
1 1
0
1 1
2 2
3 3
4 4
Answer / vidyullatha
#include<stdio.h>
main()
{
int i,j,k,l;
int space=7;
for(i=4;i>=0;i--)
{
for(j=4;j>i;j--)
{
printf(" ");
}
printf("%d ",i);
for(j=0;j<space;j++)
{
printf(" ");
}
if(space>0)
printf("%d ",i);
space = space-2;
printf("\n");
}
space = 1;
for(i=1;i<=4;i++)
{
for(j=4;j>i;j--)
{
printf(" ");
}
printf("%d ",i);
for(j=0;j<space;j++)
{
printf(" ");
}
printf("%d ",i);
space = space+2;
printf("\n");
}
}
Is This Answer Correct ? | 6 Yes | 0 No |
du u know test pattern for robosoft? Plz share
1 Answers RoboSoft, TATA, Wipro,
what is a constant pointer in C
write a program to generate 1st n fibonacci prime number
how can u print a message without using any library function in c
how to find sum of digits in C?
Differentiate between the expression “++a” and “a++”?
stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.
what is the difference between c and java?
how does a general function , that accepts an array as a parameter, "knows" the size of the array ? How should it define it parameters list ?
Can the curly brackets { } be used to enclose a single line of code?
What is a symbolic constant?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"