Need Help! Harvard's CS50 Problem Set 1: C _Itsa Mario
9:46:00 AM
After CS50 Week 1 Wednesday & Friday
What is the problem "Itsa Mario"?
http://cdn.cs50.net/2015/fall/psets/1/pset1/pset1.html#itsa_mario
http://cdn.cs50.net/2015/fall/psets/1/pset1/pset1.html#itsa_mario
What's my result?
What did I learn?
or is ||
do-while loop & for loop
I know that for loop could be simply write as follows:
for (initialization; condition; update)
{
//code inside
}
//code outside
But I still would like to explian it to myself in the notes for better understanding.
for (initial status of condition A; under what condition action B would act; how would condition A change after action B act )
{
//code inside
}
//code outside
I know that for loop could be simply write as follows:
for (initialization; condition; update)
{
//code inside
}
//code outside
But I still would like to explian it to myself in the notes for better understanding.
for (initial status of condition A; under what condition action B would act; how would condition A change after action B act )
{
//code inside
}
//code outside
What was my reference?
C Program To display the pyramid of * and digits
Write a C program to print pyramid using *.
* * * * * * * * * * * * * * * * * * * * * * * * *
#include <stdio.h>
int main()
{
int i,space,rows,k=0;
printf("Enter the number of rows: ");
scanf("%d",&rows);
for(i=1;i<=rows;++i)
{
for(space=1;space<=rows-i;++space)
{
printf(" ");
}
while(k!=2*i-1)
{
printf("* ");
++k;
}
k=0;
printf("\n");
}
return 0;
}
3 comments
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteNICE GREAT INFO ..!! WROTE MOST PATTERN PROGRAMS IN C ..WHICH WILL BE HELPFUL
ReplyDeletehttps://www.techgeekbuzz.com/pattern-programs-in-c/