Saturday, 6 February 2016
Friday, 5 February 2016
Wednesday, 3 February 2016
Programs
- > Program to swap two numbers using third variable.
- > Program to swap two numbers without using third variable.
- > Program to find square root of any no. entered.
- > Program to find power n of given no. a. ( a^n ).
- > Program to find area & circumference of circle.
- > Program to find area & perimeter of square.
- > Program to find area & perimeter of rectangle.
- > Program to find simple interest.
- > Program to convert temperature from degree centigrade to Fahrenheit.
- > Program to convert temperature from Fahrenheit to degree centigrade.
- > Program to explain the concept of if else.
- > Program to check whether input character is vowel or not.
- > Program to input no. & print corresponding day
- > Program to no. in words (1 to 10) on basis of input no.
PAGE : 1 2 3 4 5 >>>
Tuesday, 2 February 2016
programs2
Programs Based on C
- > Program to execute & explain for loop
- > Program to execute & explain do while loop
- > Program to execute & explain while loop
- > Program to print table of a given number
- > Program to count no. of digits in a given number
- > Program to check whether input no. is prime no. or not
- > Program to check whether input no. is armstrong no. or not
- > Program to check whether input no. is perfect no. or not
- > Program to find factorial of given number
- > Program to print fibonacci series
- > Program to find largest no. among n entered numbers
- > Program to check whether input no. is palindrome or not
- > Program to reverse a number
- > Program to find LCM & HCF
- > Program to find nCr & nPr
- > Program to find greatest (maximum) element in array
- > Program to implement linear search in array
- > Program to implement binary search in array
- > Program to implement bubble sort in array
- > Program to implement selection sort in array
- > Program to implement insertion sort in array
- > Program to transpose a matrix
- > Program to add diagonal elements of matrix
- > Program to add both diagonals of matrix
- > Program to find sum of left diagonal elements of matrix
- > Program to find sum of right diagonal elements of matrix
- > Program to find sum of upper (right) tiangular matrix
- > Program to find sum of lower (left) triangular matrix
Thursday, 28 January 2016
programs3
Programs Based on C
- > Program to accept a string & display it
- > Program to accept a string & display it (with spaces)
- > Program to find no. of vowels , digits , spaces & conconants in a string
- > Program to find frequency of characters in a string
- > Program to find lenght of a string
- > Program to find lenght of string without using strlen()
- > Program to copy a string
- > Program to copy a tring without using strcpy()
- > Program to concatenate a string
- > Program to concatenate a string without using strcat()
- > Program to reverse a string using strrev()
- > Program to reverse a string without using strrev()
- > Program to remove all characters of string except alphabets
Monday, 25 January 2016
Saturday, 19 September 2015
Structure Theory
Basically, a Structure is a collection of different data items, that are stored under a common name.The structure includes struct which is it's data type.
A struct in the C programming language (and many derivatives) is a complex data type declaration that defines a physically grouped list of variables to be placed under one name in a block of memory, allowing the different variables to be accessed via a single pointer, or the struct declared name which returns the same address. The struct can contain many other complex and simple data types in an association, so is a natural organizing type for records like the mixed data types in lists of directory entries reading a hard drive (file length, name, extension, physical (cylinder, disk, head indexes) address, etc.), or other mixed record type (patient names, address, telephone... insurance codes, balance, etc.).
=>The Syntax of Structure is:
struct structure_name
{
structure element1;
structure element2;
……………………
};
A struct in the C programming language (and many derivatives) is a complex data type declaration that defines a physically grouped list of variables to be placed under one name in a block of memory, allowing the different variables to be accessed via a single pointer, or the struct declared name which returns the same address. The struct can contain many other complex and simple data types in an association, so is a natural organizing type for records like the mixed data types in lists of directory entries reading a hard drive (file length, name, extension, physical (cylinder, disk, head indexes) address, etc.), or other mixed record type (patient names, address, telephone... insurance codes, balance, etc.).
=>The Syntax of Structure is:
struct structure_name
{
structure element1;
structure element2;
……………………
};
Concept of Pointers.
#include <stdio.h>
int main()
{
int *ptr, a;
a = 50;
/* ptr stores address of a */
ptr = &a;
printf(“%d”, *ptr);
getch();
}
int main()
{
int *ptr, a;
a = 50;
/* ptr stores address of a */
ptr = &a;
printf(“%d”, *ptr);
getch();
}
Program without Argument but with Return Value.
In this program, the task is to create a program having a function without arguments but with return values . So, we create a function outside the main function named as func() . In this function , int func is used as the function returns a variable of type int . Moreover , the function does not accept any variable or arguments . A function can only return a single value. With line a = func() , the program passes its control to function & when function is executed , then it passes the control to main function . Then , we will display the output after calling of the function .
#include<stdio.h>
#include<string.h>
#include<conio.h>
int func();
void main()
{ clrscr();
int a;
printf("enter value of a = ");
scanf("%d",&a);
a = func();
printf("\n\n value of a after calling of function = %d",a);
getch();
}
int func()
{ int b =10;
printf("value of b inside function = %d",b);
return b;
}
#include<stdio.h>
#include<string.h>
#include<conio.h>
int func();
void main()
{ clrscr();
int a;
printf("enter value of a = ");
scanf("%d",&a);
a = func();
printf("\n\n value of a after calling of function = %d",a);
getch();
}
int func()
{ int b =10;
printf("value of b inside function = %d",b);
return b;
}
Program without Argument and without Return Value.
In this program, the task is to create a program having a function without arguments & without return values . So, we create a function outside the main function named as func() . In this function , void func is used, as the function returns no variable . Moreover , the function will not accept any variable or arguments . With line func() , the program passes its control to function .after execution of the functions part , we will display the output .
#include<stdio.h>
#include<string.h>
#include<conio.h>
void func();
void main()
{ clrscr();
int a;
printf("enter value of a = ");
scanf("%d",&a);
func();
printf("\n\n value of a after calling of function = %d",a);
getch();
}
void func()
{ int b =10;
printf("value of b inside function = %d",b);
}
Program with Argument but without Return Value.
In this program, the task is to create a program having a function with arguments but no return values . So, we create a function outside the main function named as func() . In this function , int func is used as the function returns a variable of type int . Moreover , the function accepts an integer type variable , which are called arguments . A function can only return a single value but in this case we are not returning value . With line a = func(a) , the program passes its control to function & value passes will be stored in function variable a & then it passes the control to main function . Then , we will display the output after calling of the function .
#include<stdio.h>
#include<string.h>
#include<conio.h>
void func(int a);
void main()
{ clrscr();
int a;
printf("enter value of a = ");
scanf("%d",&a);
func(a);
printf("\n\n value of a after calling of function = %d",a);
getch();
}
void func(int a)
{ int b = a;
b = a+10;
printf("value of a inside function = %d",b);
}
#include<string.h>
#include<conio.h>
void func(int a);
void main()
{ clrscr();
int a;
printf("enter value of a = ");
scanf("%d",&a);
func(a);
printf("\n\n value of a after calling of function = %d",a);
getch();
}
void func(int a)
{ int b = a;
b = a+10;
printf("value of a inside function = %d",b);
}
Program with Arguments & Return Values.
In this program, the task is to create a program having a function with arguments & with return values . So, we create a function outside the main function named as func() . In this function , int func is used as the function returns a variable of type int . Moreover , the function accepts an integer type variable , which are called arguments . A function can only return a single value . With line a = func(a) , the program passes its control to function & value passes will be stored in function variable a & then it returns the value to main function which is stored in main's a variabe . Then , we will display the output after calling of the function .
#include<stdio.h>
#include<string.h>
#include<conio.h>
int func(int a);
void main()
{ clrscr();
int a;
printf("enter value of a = ");
scanf("%d",&a);
a = func(a);
printf("value of a after calling of function = %d",a);
getch();
}
int func(int a)
{ int b = a;
b = a+10;
return b;
}
#include<stdio.h>
#include<string.h>
#include<conio.h>
int func(int a);
void main()
{ clrscr();
int a;
printf("enter value of a = ");
scanf("%d",&a);
a = func(a);
printf("value of a after calling of function = %d",a);
getch();
}
int func(int a)
{ int b = a;
b = a+10;
return b;
}
Monday, 7 September 2015
Maths
A Leap year is a year with 366 days
Normally, a year consist of 365 days
basically, the extra day is the 29th Feb
so, to find that year with that extra day,
The Formula:
-Leap Years are evenly divided by 4.
-Except those which can evenly divided by 100.
-Also, except those which can also divided by 400.
-Except those which can evenly divided by 100.
-Also, except those which can also divided by 400.
Saturday, 5 September 2015
c 4.5 software
To download the free basic Turbo C/C++ version 4.5 ( from boreland ) click on below download button : -
----->> Download
Features of the software : -
- It is very easy to use & operate.
- Supports C , C++ programs.
- Basic C version used in schools & colleges.
- It is the latest version with no errors.
- Create any no. of programs & enjoy programming.
- So, downlaod the software free of just 24 mbs.
- Using it is just like using MS WORD.
- Just click on install.exe after downloading
c software 3.0
To download the free basic Turbo C version 3.0 click on below download button : -
----->> Download
Features of the software : -
- It is very easy to use & operate
- Supports C , C++ programs
- Basic C version used in schools & colleges
- Create any no. of programs & enjoy programming
- So, downlaod the software free of just 3 mbs
functions theory
Functions can be called in 2 ways either with arguments or without arguments in C program. So, these functions may or may not return values to the calling function. So, the functions are divided into 4 categories listed below : -
- C function with arguments (parameters) and with return value
- C function with arguments (parameters) and without return value
- C function without arguments (parameters) and without return value
- C function without arguments (parameters) and with return value
| S.no | C function | syntax |
| 1 | with arguments and with return values | int function ( int ); // function declaration function ( a ); // function call int function( int a ) // function definition {statements; return a;} |
| 2 | with arguments and without return values | void function ( int ); // function declaration function( a ); // function call void function( int a ) // function definition {statements;} |
| 3 | without arguments and without return values | void function(); // function declaration function(); // function call void function() // function definition {statements;} |
| 4 | without arguments and with return values | int function ( ); // function declaration function ( ); // function call int function( ) // function definition {statements; return a;} |
Saturday, 29 August 2015
Recursion Theory
In C programming language, when a function calls itself over and over again, that function is known as recursive function. The process of function calling itself repeatedly is known as recursion.
Recursion in computer science is a method where the solution to a problem depends on solutions to smaller instances of the same problem (as opposed to iteration). The approach can be applied to many types of problems, and recursion is one of the central ideas of computer science.
The Syntax,
Subscribe to:
Posts (Atom)






