Posts

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&

C- Computer programming language-field of study

Image
C- Computer programming language-field of study C- Computer programming language-field of study After 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: Software Type of software System Software Application Software Programming language Types of programming language Low level high level Software Wikipedia 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 So

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 ();