C Practical and Assignment Programs-Pattern Printing 4

preview_player
Показать описание
C Practical and Assignment Programs-Pattern Printing 4
In this video we are going to write a program to print a pattern consisting of numbers . 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:
1
2 4
3 6 9
4 8 12 16
5 10 15 20 25

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

we can write code for this pattern using some basic knowledge, another way to write the code for this pattern is
#include<stdio.h>
int main()
{
int i, j;
for(i=1;i<=5;i++)
{
for(j=i;j<=i^2;j++)
{
if(j%i==0)
printf("%d ", j);
}
printf("\n");
}
}
Even though it is lengthy beginners will understand it easily
Thank you :)

sreeramsaivatsow
Автор

You just cleared my doubts on pattern printing :')
Tysm dude!

allwynization
Автор

Chaitanya Koripella We will surely get back to you with the code. It great that you know PHP.

wethecomputerguys
Автор

IS this Below program is correct for pattern 4???


int main()
{
int row, col1, col2, no.of rows, no.of col;
no.of rows=5;
no.of col=no.of row;
for(row=1;row<=no.of rows)
{

{
printf(" ");
}
for(col2=1;col2<=no.of col;col2++)
{
printf("*");
no.of col--;
}
return 0;
}

kowsiselva
Автор

Hello - This is regarding pattern.
****
***
**
*
I would like to print this pattern using first INCREMENTING FOR row loop (in below code ) instead of decrementing loop. Is it possible ?
I tried to do that but it gives me a triable.
I tried to solve this using decrementing first for loop and it worked.

for(i=5;i>n=1;i--)
{
for(j=5;j>i;j--)
{
printf(" ");
}
for(k=1;k<=i;k++)
{
printf("*");
}
printf("\n");
}

rakeshchaudhary
Автор

what is the name of the software you are using for writing c language

engineeringhex
Автор

this video helpfull for me thank u for uploading

garikayoutubechannel
Автор

Change cnt's initial value to 0 instead of 1 on line number 3 
and also change line 10 to  printf("%d ", cnt++%3+1);  instead of printf("%d ", cnt++);

wethecomputerguys
Автор

Sir please tell me how to solve the above question using only ONE FOR LOOP.

vijayrathore
Автор

sir pls explain the program of palindrome
.i need it urgently

AV-kbex
Автор

sir could you please tell me the best site for practicing on-line .

BTechWithLaw
Автор

explain how to find a prime and twin prime number within a range of two numbers

surajpandey
Автор

Sir l need ur help to print this pattern, that are mentioned in below
*####
###**
***##
###**
*####

kanhusahoo
Автор

can you provide the user defined basic code for adding subtracting multiplying and deviding numbers

mohammedshujaatsayani
Автор

include a video on a program to calculate binary additiions withh logic

sunilthapa
Автор

Sir I want program for this
We give 12 as input
The out put should be
1 2
1 3 2
1 4 3 5 2
1 5 4 7 3 8 5 7 2

krishnaambati
Автор

 Could you do
1
12
123
12345

Using only nested For Loops and these printf statements : ( " ") ("*") and ("\n") once? 
It would be awesome if you could do this only using one of the following statements.
I've seen some of my peers do it. I can't seem to do the 4 row since it skips from 3 to 5.

viewerguy
Автор

can u  please give the answer for pattern  u asked in the video ????

chhavimitharwal
Автор

1:15 - Mistake in 4th line.

It is: "4 8 12 16" and not "4 8 16 20".

Anyway, Thanks for the video! (:

anirudhm
Автор

Program for
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15

prasadburagadda