Posts

Showing posts from February, 2016

Print pattern in c - explore new perspectives in pattern printing

Image
Print pattern in C You will be able to :>> Design any kind of pattern>>Understand element of pattern designing>>Understand patterns>>Understand loop in c>>Understand Sequence analysis What is Pattern? A pattern is set of  same or different kind of things that represent definite geometrical shapes or size.

Geometrical shape can be  TriangleSquarePramid If you look above picture than difinetly you will find repetition of shapes or color in definite manner .

 It's example of pattern.
For Creating sucessfull Pattern , You must know

LoopElement of patternSequence analysis of pattern Loop loop are the control statement .

They are used when programmer needs to execute certain part of program for definite repetation

Different kinds of loop are
For loopWhile loopDo while loop Among these for loop is used when the number of repetition is known.

Although while and do-while loop can be used while number of loop is known but it is a bit complex

As above explained Pat…

what everybody ought to know about string in c.

Image
String in C You will be able to :>> Define string>>Declaration of String>>Initialization of String>>Use string handling function String
In C programming, array of character are called strings. A string is terminated by null character /0.


Array is the collection of similar data under common name.


A common name is the name of string or array.For example:

char stringname  = "Hello";  Here stringname is common name .We will study String Decleration below Section.


 C  compiler represent above string as below image (string representation)


Declaration of String
It is declared as:


char string_name[size];

E.g: char name[10];


Strings can also be declared using pointer.
char *p
Initialization of String
It can be initialized when they are declared


char c[]="abcd";      OR, char c[5]="abcd";      OR, char c[]={'a','b','c','d','\0'};      OR; char c[5]={'a','b','c','d'…

C- Computer programming language-field of study

Image
C- Computer programming language-field of studyAfter reading this tutorial  ,  you will be able to :>> Define software and programming language>> Have knowledge about type of software and programming language >> Have knowledge about advantage and disadvantage of different programming language CONTEXT:SoftwareType of softwareSystem SoftwareApplication SoftwareProgramming languageTypes of programming languageLow levelhigh level SoftwareWikipedia describe software as "Computer software also called a program or simply software is any set of instructions that directs a computer to perform specific tasks or operations " .In simple word software is a set of coded commands or programs that tells a computer what tasks to perform.It consists of computer programs, libraries and related non-executable data (such as online documentation or digital media)
Types of Software System Software Software that directly operates the computer hardware, to provide basic functiona…

Cube sum program of individual digit of number in c with description

Image
What is cube sum program written in c ?In cube sum program , we  find cube of individual digit of a number and find their sum .for example: 123 =  1^3 + 2 ^3 + 3^3.
Cube of individual digit have to be found for that we have to extract each digit .As we know last digit of number can be extract using modulus division (i.e 123%10 = 3 ) , And if we do integer division of given number by 10 , we can get other digit excluding last digit .


Code of  cube sum program: // Cube sum program  of individual digit of number in c start
#include <stdio.h>
#include <conio.h>
int main()
{
   int number;

printf("enter a number to find cube sum");

   scanf("%d", &number);

   int n2,cube,cubesu=0;

while(number!=0)
     {

        n2 = number%10;

        cube = n2*n2*n2;

        cubesu = cubesu + cube;

        number = number/10;
      }

printf("cube sum is %d\t", cubesu);
getch();
  return 0 ;
// Cube sum program  of individual digit of number in c start
}

How cube sum program work…