tag:blogger.com,1999:blog-5571795200996649673.post6976362430986458106..comments2024-03-28T12:47:57.075+05:30Comments on Program in C: Number Pattern - 19Nimish Garghttp://www.blogger.com/profile/15795821721808548808noreply@blogger.comBlogger18125tag:blogger.com,1999:blog-5571795200996649673.post-33374150694147948422021-08-06T10:43:28.852+05:302021-08-06T10:43:28.852+05:30Write a C program for the following pattern?
0
...Write a C program for the following pattern?<br /><br /><br />0<br /><br />7 0 7 <br /><br />6 7 0 7 6 <br /><br />5 6 7 0 7 6 5 <br /><br />4 5 6 7 0 7 6 5 4 <br /><br />3 4 5 6 7 0 7 6 5 4 3 <br /><br />2 3 4 5 6 7 0 7 6 5 4 3 2 <br /><br />1 2 3 4 5 6 7 0 7 6 5 4 3 2 1 Anonymoushttps://www.blogger.com/profile/09634236704071246418noreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-65844256793982624432019-12-29T09:21:38.251+05:302019-12-29T09:21:38.251+05:30thankuthankuAnonymoushttps://www.blogger.com/profile/06039457926686848031noreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-52022059589565448422019-07-23T22:34:19.523+05:302019-07-23T22:34:19.523+05:30#include
void main()
{
int i,j;
for(i=1;i<...#include<br />void main()<br />{<br /><br /> int i,j;<br /> for(i=1;i<5;i++)<br /> {<br /> for(j=i*(i-1)/2+1;j<=i*(i+1)/2;j++)<br /> printed("%d ",j);<br /> print("\n");<br /> }<br />}Anonymoushttps://www.blogger.com/profile/15982243403103588649noreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-83333570963450893892018-04-21T04:11:56.557+05:302018-04-21T04:11:56.557+05:30very strong logic good sir g
very strong logic good sir g<br />Anonymoushttps://www.blogger.com/profile/11854229797204776423noreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-88928073437060876062018-03-19T11:43:09.559+05:302018-03-19T11:43:09.559+05:30If k=1 then it will print 2 ati=1 and j=1. We need...If k=1 then it will print 2 ati=1 and j=1. We need 1 at I=1and j=1. So we need to put k=0 no?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-13739207262441629972017-09-15T21:59:36.319+05:302017-09-15T21:59:36.319+05:30Thank you so much sir.Thank you so much sir.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-66651002562651989672017-09-13T05:40:57.079+05:302017-09-13T05:40:57.079+05:30#include
int main()
{
int i,j,k;
k=1;
printf(&...#include<br />int main()<br />{<br /> int i,j,k;<br /> k=1;<br />printf("%d",k);<br />printf("\n");<br /> for(i=2;i<5;i++)<br /> {<br /> for(j=1;j<=i;j++)<br /> {<br /> printf("%d",k++);<br /> }<br /> printf("\n");<br /> }<br /> return 0;<br />}Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-31658237928362134832017-09-11T10:49:03.473+05:302017-09-11T10:49:03.473+05:30k++ is postfix increment, which is done after the ...k++ is postfix increment, which is done after the statement is executed.Nimish Garghttps://www.blogger.com/profile/15795821721808548808noreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-78775272603722711912017-09-10T21:30:19.135+05:302017-09-10T21:30:19.135+05:30Sir can you please explain why we are getting outp...Sir can you please explain why we are getting output from 1 ,if k++ has been used and it was initialised by 1 the output should start from 2 .Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-21663095488760505082017-06-28T07:36:23.624+05:302017-06-28T07:36:23.624+05:30// A program written very silly
1 // Program wi...// A program written very silly <br /> 1 // Program will display the following pattern<br /> 2 // 1<br /> 3 // 2 3<br /> 4 // 4 5 6<br /> 5 // 7 8 9 10<br /> 6 #include <br /> 7 <br /> 8 int main(void)<br /> 9 {<br /> 10 <br /> 11 int i, j, k;<br /> 12 <br /> 13 for(i = 1, k = 0; i < 10; ++k, i += k)<br /> 14 {<br /> 15 for(j = i; j <= (k + i); j++)<br /> 16 {<br /> 17 printf("%3d", j);<br /> 18 }<br /> 19 printf("\n");<br /> 20 }<br /> 21 return 0;<br /> 22 }<br />Anonymoushttps://www.blogger.com/profile/14383414957653525295noreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-25437627878356187262016-11-20T11:57:29.431+05:302016-11-20T11:57:29.431+05:30#include
int main()
{
int r,i,j,k;
prin...#include <br /><br />int main()<br />{<br /> int r,i,j,k;<br /><br /> printf("Enter the no. of rows : ");<br /> scanf("%d",&r);<br /><br /> for(i=1,k=1;i<=r;i++)<br /> {<br /> for(j=1;j<=i;j++,k++)<br /> {<br /> printf("%d",k);<br /> }<br /> printf("\n");<br /> }<br />}Anonymoushttps://www.blogger.com/profile/03752847156760646436noreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-6486592143653873262016-08-29T03:01:18.561+05:302016-08-29T03:01:18.561+05:30ankita anand ,
because u cannot predict the value ...ankita anand ,<br />because u cannot predict the value naturally that where its ending in each row that is<br />weather 3 6 pr 10 <br />in the ist line its printing from 1 to 1 as the value of i is equal to 1<br />similarly <br />in the second line its printing the from the incremented value of i ie <br />from 2 to 3 as i = 2 here so two time u are printing two numbers two and 3 as k is also incrementing simultaneously<br />got it?Anonymoushttps://www.blogger.com/profile/08100021290226971946noreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-49904303300911321772016-03-22T21:12:06.453+05:302016-03-22T21:12:06.453+05:30why j<=iwhy j<=iAnkita Anandhttps://www.blogger.com/profile/16331233713742176697noreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-49975735423882187002016-03-03T22:32:06.777+05:302016-03-03T22:32:06.777+05:30#include
int main()
{
int i,j,k,n;
printf(&quo...#include<br />int main()<br />{<br /> int i,j,k,n;<br /> printf("Enter value of n:")<br /> scanf("%d",&n);<br /> k=1;<br /> for(i=1;i<n;i++)<br /> {<br /> for(j=1;j<=i;j++)<br /> {<br /> printf("%d",k++);<br /> }<br /> printf("\n");<br /> }<br /> return 0;<br />}Rajiv's Bloghttps://www.blogger.com/profile/09718708685810554974noreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-52986886026270834072016-02-09T15:07:16.014+05:302016-02-09T15:07:16.014+05:30sir pls do this program using only two variable i ...sir pls do this program using only two variable i and j not any other variable Anonymoushttps://www.blogger.com/profile/06657471869381511556noreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-39252992097207926442015-11-28T20:18:42.526+05:302015-11-28T20:18:42.526+05:30the program has prototype error.the program has prototype error.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-35864264672394093402014-10-05T19:00:54.260+05:302014-10-05T19:00:54.260+05:30insert printf and scanf to scan the value of n
the...insert printf and scanf to scan the value of n<br />then instead of i<5, put i<nAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-5571795200996649673.post-83702748270532356972014-05-11T18:47:41.353+05:302014-05-11T18:47:41.353+05:30program to print the above pattern up to a given v...program to print the above pattern up to a given value n & the program should use a function which takes n as its parameter..........<br /><br />pls help me....Anonymoushttps://www.blogger.com/profile/08289964814849017979noreply@blogger.com