C Practical and Assignment Programs-Pattern Printing 3

preview_player
Показать описание
C Practical and Assignment Programs-Pattern Printing 3
In this video we are going to write a program to print a pattern in form of right angled triangle consisting of "*". We are going to use nested for loops ie one loop inside another.The full description of question is provided below. Now this program is written in C programming language but will work in C++.Fell free to provide you suggestion.

Q. To print various patterns using loop constructs like:
*
* *
* * *
* * * *
* * * * *

We The Computer Guys
Shreyas Zagade
Aakash Thakur
Ananya Jain
Рекомендации по теме
Комментарии
Автор

really you are not a normal teacher who can understand what the students need befor making them understand that is not a normal teacher thank you with all regards

gghhff
Автор

Is this exercise too complicated to understand in the beginning or it's normal to get and i'm being dumb ?
The explanation was very good, thanks !

pedroafonso
Автор

You actually explained much better than my teacher! Thanks

cdz
Автор

it helped me a lot, am a beginner in C programming

gregorydamien
Автор

thanx to publisher of this video..
this is really helpful to learn and understand the concept of nested looping..
thanx

sayeedroshan
Автор

very nicely explained, thank you for sharing this tutorial sir, keep it up 👍👍

SmartProgramming
Автор

this code is not running ..surely there is a problem.moreover for space printig can be used

srijanmukhopadhyay
Автор

I simplified the problem here for some people that need help.


#include <stdio.h>
#include <stdlib.h>
#include <string.h>


int main() {
int rows, cols;
int numberOfRows;

printf("Enter No Of Rows:");
scanf("%d", &numberOfRows);
char printSpace = ' ';
char printStar = '*';

for(rows = 1; rows <= numberOfRows; rows++) {
for(cols = numberOfRows; cols >= rows; cols--) {
printf("%c", printSpace);
}
for(cols = 1; cols <= rows; cols++) {
printf("%c", printStar);
}

printf("\n");
}

return 0;
}

cafafans
Автор

For the dashes printing: since coll = 1, how did the first line of the output get 5 dashes?

timewrath
Автор

thanks u .. i m learning a lot from your video... and i m able to solve some more patterns... thanks u
 

prashantkb
Автор

Please do a explanation video of this...HOW WILL COMPILER EXECUTE THIS PROGRAM.

veerwise
Автор

thank you so much this was really helpful

marytonwe
Автор

I want a program in which loop and function are use in 1 program and it should be easily understandable...

tanmaychandak
Автор

Another way to write the same code.



int row, col, space, no_row;
char star='*';

printf("Enter the number of rows: ")
scanf("%d", &no_rows);

for(row=1;row<=no_rows;row++)
{



{
//printing spaces
printf(" ");
}
for(col=1;col<=rows;col++)
{
//printing stars
printf("%c", star);
}
//after the end of every row
printf("\n");

}

NoorAli-uhuq
Автор

Hi bro first of all, i would like to say thank you !! . i can do easily my homework of course i had to undestand your logic but i really could to do it thanks bro keep it up !! mi pe

bayroncastillo
Автор

can you guys help me to display right triangle peak using asteris.

sarahjarabese
Автор

i need to know how to put all 4 triangles together in code can you please help me show me the code on how to do so its called repetition 4 triangles

nicolewillis
Автор

Sir Borland Turbo C++ 5.02 mai console window instantly disappear ho jati h solve this

naumansohail
Автор

Hello sir, your way of explanation is damn good. Could you plz make a vedio on *pattern having shape of letter N and X. Tomorrow is my xam so plz help me .. if vedio is Not possible then plz send the code I'll try to understand it.

premasati
Автор

how to build a triangle that has the binary value of the row for example:
1
10
011
0100
and so on

רוניפינקל