Showing posts with label Learn C in Bopal-Ahmedabad. Show all posts
Showing posts with label Learn C in Bopal-Ahmedabad. Show all posts

Wednesday, January 1, 2020

What is Type-Casting in C? tccicomputercoaching.com


Type-Casting means we can convert from one data type to another data-type.


There are 2 types of casting:

1. Internal

2. External:

  1. In internal compiler convert from small type to large type.
For Example,

int x;

float y;

z=x+y;

here, x- integer type converted to float type y automatically.
  1. External
In External User manually convert from one data-type to another data-type.

Syntax:

(type)value;

float y=(float )9/4;

TCCI Computer Coaching teaches various basic concepts to the students in Bopal and Satellite in Ahmedabad.

We teach C, C++, Java, Python, Database Management, Python, Data Structure HTML,CSS, Java Script, .Net , PHP, System Programming Compiler Design, Boot Strap, Angular Js etc.

Hurry up!!!

Get Admission at TCCI.

call us@9825618292.

visit us@tccicomputercoaching.com

Saturday, December 29, 2018

User Defined Function in C-Tccicomputercoaching.com

What is User Defined Function?

A User Defined Function is a block of code developed by user to perform specific task.

Using user Defined Function we can divide a complex problem into smaller modules. So we can decrease complexity and lengthy.

C allows programmer to define functions according to their need. These functions are known as user-defined functions. For example:

Suppose, a program which includes addition, subtraction, division and multiplication of two numbers in same program. You can create user defined functions for each operation individually to solve this problem:



For example,

#include <stdio.h>
#include <conio.h>

Void add(int, int); // function prototype
Void sub (int, int); // function prototype
Void mul (int, int); // function prototype
Void div (int, int); // function prototype

void main ()
{
inta,b;
printf(“enter the value of a and b);
scanf(“%d %d”,&a,&b);
clrscr ();
add (a,b);
sub (a,b);
mul (a,b);
div (a,b);
}

Void add (int x,int y)
{
Int c;
C=x+y;
printf(“%d”,c)
}

void sub ()
{
Int c;
C=x-y;
printf (“sub=%d”,c)
}

Void mul ()
{
int c;
C=x *y;
printf (“%d”, c)
}

Void div ()
{
int c;
C=x/y;
Printf(“div=%d”,c)
}

User Defined Function has 3 sections:
Function Prototype
Function Call
Function Definition

Function prototype:

Syntax of function prototype :
returnTypefunctionName(type1 argument1, type2 argument2,...);

A function prototype is simply the declaration of a function that specifies function's name, parameters and return type. It doesn't contain function body. Parameters names are optional.

Function Call:

Syntax of Function Call:
Function name (argument1, argument2);
We can use only value also. i. e. add (5, 6);

Compiler starts compilation from main () function, so to jump control from main to user defined function, have to use function call. When this function call executes, control jumps from main to that particular user defined function.

Function Definition:

Syntax of Function Definition:
returnTypefunctionName(type1 argument1, type2 argument2,...)
{
Body of function
}

When a function is called, the control of the program is transferred to the function definition. And, the compiler starts executing the codes inside the body of a function.

Passing arguments to a function:

In programming, argument refers to the variable passed to the function. In the above example, two variables a and b are passed during function call.

The parameters x and y accepts the passed arguments in the function definition. These arguments are called formal parameters of the function.

The type of arguments passed to a function and the formal parameters must match, otherwise the compiler throws error.

Return Statement:

The return statement terminates the execution of a function and returns a value to the calling function. The program control is transferred to the calling function after return statement.

TCCI-Tririd Computer Coaching Institute is focused on providing Quality education with practical sessions. At TCCI student can learn various programming languages like c , c++, Java, Data Structure, Python etc...

If you like this post then please share and like this post.

Call us @ 98256 18292.

Visit us @ tccicomputercoaching.com

Tuesday, November 6, 2018

Which one is better for a beginner, C++ or Java?tccicomputercoaching.com

First start from C, then C++, then Java.

Even if you wish to have Java as your primary programming language you must give some time to C & C++, may be a month to C & then two months to C++, you'll have pretty good command over the basics of programming, then move towards Java.

Because Java gives you so many things pre-built in you will not get much of the basic to practice, so it won't be a healthier step to go with java directly.

To learn c++ and Java programming Language at TCCI .

Call us 98256 18292.

Visit us @ http://tccicomputercoaching.com/