Monday 7 October 2019

C program for pyramid

Logic to print pyramid star pattern

    *
   ***
  *****
 *******
*********
Before you read further have a close look at the above pattern. The pattern consists of N (for this case 5) rows. Each row contain exactly 2 * N - 1 stars. In addition to stars the pattern has leading spaces. Each row contain N - i spaces (where i is current row number). To count total spaces per row point your mouse over the above pattern.
Step by step descriptive logic to print Pyramid star pattern.
  1. Input number of rows to print from user. Store it in a variable say rows.
  2. To iterate through rows, run an outer loop from 1 to rows. The loop structure should look like for(i=1; i<=rows; i++).
  3. To print spaces, run an inner loop from i to rows - 1. The loop structure should look like for(j=i; j<rows; j++). Inside this loop print single space.
    Note: Iterating from 1 to N - i or i to rows - 1 both are equal.
  4. To print star, run another inner loop from 1 to 2 * i - 1. The loop structure should look like for(j=1; j<=(2*i - 1); j++). Inside this loop print star.
  5. After printing stars for current row, move to next line i.e. print new line.

Program to print pyramid star pattern series

/** * C program to print equilateral triangle or pyramid star pattern */ #include <stdio.h> int main() { int i, j, rows; /* Input number of rows to print */ printf("Enter number of rows : "); scanf("%d", &rows); /* Iterate through rows */ for(i=1; i<=rows; i++) { /* Print leading spaces */ for(j=i; j<rows; j++) { printf(" "); } /* Print star */ for(j=1; j<=(2*i-1); j++) { printf("*"); } /* Move to next line */ printf("\n"); } return 0; }

Tuesday 24 September 2019

Knowledge bank

CHARGE YOUR SMARTPHONE BY MAKING THIS COOL WIND TURBINE USING A COMPUTER FAN

for details:Click here

26 INNOVATIVE IDEAS GIVEN BY SCHOOL CHILDREN.

for details:Click here

Google unveils 'computer-on-a-stick
for details:Click here

Art-ificial Intelligence? Algorithm Sorts Paintings Like a Person
for details:Click here

High-Tech 'Smart' Cane Helps Blind People Recognize Faces
for details:Click here

Pocket-Size Drone Can Fold Up Like Origami
for details:Click here

Over-Unity Reaction less Generator Invented In India
for details:Click here

Save the internet(net neutrality)
for details:Click here

5 WAYS THE NEXT 10 YEARS ARE GOING TO BLOW YOUR MINDFOR DETAILS:CLICK HERE

10TB SOLID STATE DRIVES MAY SOON BE POSSIBLE
FOR DETAILS:
CLICK HERE

GARMIN VIVO ACTIVE : GPS WATCH REVIEW
FOR DETAILS:
CLICK HERE

THE WORLD'S MOST POWERFUL ATOM SMASHER RESTARTS WITH A BIG BANG
FOR DETAILS:
CLICK HERE

SALARY OF GOOGLE'S NEW CFO PORAT REVEALED
FOR DETAILS:
CLICK HERE

A CHAT WITH DR NARESH ,TREHAN, (HEART SPECIALIST) AT MEDANTA-"THE MEDICITY" GURGAON  ARRANGED BY WIPRO FOR ITS EMPLOYEES.

for details:Click here

INDIA INCHES CLOSER TO GETTING ITS OWN GPS

for details:Click here

INDIAN NAVIGATION SYSTEM GETS EXPANSION WITH PSLV LAUNCH

for details:Click here

MIO FUSE: FITNESS TRACKER

for details:Click here

VIRTUAL-REALITY HEADSETS

for details:Click here


SECURE MOBILE FINGERPRINT IDENTIFICATION SYSTEM

for details:Click here


THE TOP 50 APPS FOR CREATIVE MINDS

for details:Click here


FWD: SCI-FI CLOAKING DEVICE COULD PROTECT SOLDIERS FROM SHOCK WAVES

for details:Click here


A NEW DATA TRANSFER RECORD: 43 TERABITS PER SECOND

FOR DETAILS:CLICK HERE


INTEL ANNOUNCES THE FIRST 14 NANOMETRE PROCESSOR

for details:Click here

SANDISK CRAMS 200 GB INTO THE WORLD'S HIGHEST CAPACITY MICROSD CARD

for details:Click here

SAMSUNG'S NEXT SMARTWATCH MAY COME WITH 8-CORE PROCESSOR

for details:Click here
 FOR DIRECTLY DOWNLOADING THE TEXT BOOKS :-CLICK HERE


NOTES:

       2-1 SEM NOTES                               3-1 SEM NOTES

ALL SUBJECTS NOTES              ALL SUBJECTS NOTES
        CLICK HERE                                   CLICK HERE

***In case of failure while you are opening the material through drive link, kindly please open them using the zip Extractor  since those are RAR files. You can download the file directly from it.**

***FOR EXTRA INFORMATION REGARDING THE SUBJECTS YOU CAN VISIT ELSDM***

WWW.JNTUH-ELSDM.IN