Thursday, 16 July 2015

Escape Sequence in c language

The Escape Sequence Using For in c Language. Escape sequence Mostly Used in Printf() Operation in c program. We check the operation below also. But,  1st  Learn Why Use Escape Sequence?


Different Type of Outputs Represents in c program.

\n                                          Represents a newline character

\r                                           Represents a carriage return

\b                                          Represents a backspace

\f                                           Represents a from-feed character

\t                                           Represents a horizontal tab

\v                                          Represents a vertical tab

\a                                          Inserts a bell (alert) Character or ( Beep Sound )

\?                                          Inserts a question mark Symbol ( ? )

\"                                           Inserts a Double Quote ( " )

\'                                           Inserts a single Quote ( ' )

\\                                           Inserts a Backslash ( \ )

Trigraph Sequences 

In General Every One Ca Use questions mark directly in string. The \?  escape sequence only exists because there are nine special sequence of characters called Trigraph Sequence. That are Three Characters Sequence for Representing each of the characters #, [, ], \, ^, ~, /, {, }. 

??=         #

??(         [

??)         ]

??/        \

??<        {

??>        }

??'         ^

??!        |

??-        ~

Example : 

Printf(" ??<Welcome Alltechprograms??>");

Output:

{ Welcome Alltechprograms }

logo

Explain C Program Step By Step

The C Program Can Be Explained Using Simple Program. Because, Understand Every One Way Of Learning in C Program & also Explain  comments where do use in c program. 

Program

#include<stdio.h>                                    //  This is a preprocessor directive

int main(void)                                           //  This is identifiers the function main()

{                                                               //  This marks the beginning of main()

printf("Welcome Alltechprograms");        //  This line outputs a quotation 

return 0;                                                   //  This return control to the operating system 

}                                                              //  This marks the end of the main() 


Then above the Symbol  //. Using For C Program Explain time. ( Good Way Understand ). Now , Comments also Be Used Explain Symbols in c program  /* sum text */ .

Comments Using Sample in C Program

#include<stdio.h>   /* This Line is a Preprocessor   directive  */


logo

Wednesday, 15 July 2015

Create C Programs Using Fundamental Stages

Create c Programs Using Fundamental Stages are 4 (Four) Types.

  1. Editing.
  2. Compiling.
  3. Linking.
  4. Executing.
Now , Below Explain The Each Topic

Editing

Editing is the process of creating and modifying C Source code. In Fact, an editor often provides a complete environment for Writing, Managing,Developing and testing your Programs.This is Some Times called as IDE ( Integrated Development Environment ). The Editor Using General Purpose Text Editor To Create Your Source Files.


Compiling

The Compiler converts your Source Code into Machine Language and detects and reports in the compilation process. The input to this stage is the file you produce during your editing, which is usually referred to as a source file.


Linking

The Linker Combines the object modules generated by the compiler from source code files ,adds required code modules from the standard library supplied as part of c, and welds everything into an executable whole. The Linker also detect the errors.

Executing

The Execution stage is where our run the program, having completed all the previous process successfully. But, Some Times  This stage can also generate a wide variety of error conditions. That can include producing the wrong output. We Can Use also Run  windows .exe file for Executing Output Display.

The Above Section is  Explain The Some Instructions For C Program Compile And Execution Statements.

Sample Program

#include<stdio.h>
int main()
{
printf("Welcome Alltechprograms !!");
return 0;
}

logo

Friday, 10 July 2015

armstrong number in c program

Armstrong Numbers in C Program


Armstrong Number :  The Armstrong Numbers is a Number. Such That the Sum ! of it's digits raised to the third power is equal to the number ! itself.

For Example :  Take A Armstrong Number Like 153

1 3  + 53    +33  =  1+ 125 + 27 = 153      //  Here Power of 3 is number of digits in Given number.

Program For Armstrong Number Find in c Program

#include <stdio.h>
 int power(int, int);
 int main()
{
   int n, sum = 0, temp, remainder, digits = 0;
   printf("Enter an integer\n");
   scanf("%d", &n);
   temp = n;
   while (temp != 0) 
{
   digits++;
   temp = temp/10;

}

   temp = n;
   while (temp != 0) {
   remainder = temp%10;
   sum = sum + power(remainder, digits);
   temp = temp/10;
 }

   if (n == sum)
  printf("%d is an Armstrong number.\n", n);
   else
   printf("%d is not an Armstrong number.\n", n);
   return 0;
}

int power(int n, int r) 
{
   int c, p = 1;
   for (c = 1; c <= r; c++) 
   p = p*n;
   return p;   

}

Outputs


armstrong






logo

Addition two Pointers in c Program

 Addition of pointers in c program


Pointer: A pointer can be declare as a ( * ) Symbol. Now Bellow Can Be Addition Of Two Variable Pointers Example Program With Outputs.

Program

#include<stdio.h>
int main()
{
int *a,*b,c,first,second;
printf("enter the two numbers :\n");
scanf("%d%d",&first,&second);
a=&first;
b=&second;
c=*a+*b;
printf("the Sum Of Two Pointers : %d",c);
}

Output

pointers addition
logo

Sunday, 5 July 2015

Loops in c Language

Loops in C Language

Loops : The Computer lies in its ability to perform a set of instructions repeatedly. That Means Loop is Number of Times Repeat Until a Particular Condition is Satisfied. This Repetitive Operation is Done Through a Loop Control Statement. 
loops in c language alltechprograms

There are Three Methods. They are,
  • Using a For Statement 
  • Using a While Statement
  • Using a do-While Statement
First we need to Understanding While Loop in C Program.

While Loop: In This Case programming that you want to do something a fixed number of times. The while loop mostly Cases use for calculate salary of different no.of persons. Convert to temperature from centigrade to Fahrenheit .

Sample Program For While Loop

#include<stdio.h>
int main()
{
int p,n,count;
float r,si;
count=1;
while (count<=3)
{
printf("Enter values p,n,r:\n");
scanf("%d%d%f",&p,&n,&r);
si=p*n*r/100;
printf("Interest = %f",si);
count=count+1;
}
}

For Loop:  The For Loop is Most Popular in looping instruction  c Programming Language . Why For Loop is Popular ? . For loop Having  Three stages Complete at a line.

General Form For Loop Syntax

for ( initial value; test value; increment value )

Sample Program

#include<stdio.h>
int main()
{
int a;
printf("Enter a Values:\n");
scanf("%d",&a);
for (a=a;a<=10;a++)
{
printf("Enter The Value is %d\n",a);
}
}

Nested Loops : The Nested Loop process With in while and for loops in c programming Language.

Sample Program For Nested Loop in For Loop !!

#include<stdio.h>
int main()
{
int r,c,sum;
for(r=1;r<=3;r++) //outer loop
{
for(c=1;c<=2;c++) // inner loop
{
sum=r+c;
printf("r=%d C=%d sum=%d \n",r,c,sum);
}
}
}

Odd Loop : The odd loop using for the far executed the statement with in ten a finite number of times.The odd loop function can be used in below program with do or while methods.

Program For Odd Loop

#include<stdio.h>
int main()
{
char another;
int x;
do{
printf("Enter a Number :");
scanf("%d",&x);
printf("Square of %d Value %d",x,x*x);
printf("\n we want to Enter the Another Number : y/n");
scanf("%c",&another);
}
while(another=='y');
}

Break Statement : The Break Statement is using in loop process jump the out of the loop.

For Example Break Statement in C
                                                                   // prime number Checking
#include<stdio.h>
int main()
{
int num,i;
printf("Enter number");
scanf("%d",&num);
i=2;  // initial value
while( i <=num-1)
{
if(num%i==0)
{
printf("This Number is not Prime ");
break;
}
i++;
}
if(i==num)
printf("prime number");
}

Continue Statement : The Continue Statement is some programming situations. we want to take the control to the beginning of the loop , by passing the statement inside the loop , which have not yet been executed. 
Using Keyword  " continue ".

Sample Programs for continue 

#include<stdio.h>
int main()
{
int i,j;
for(i=1;i<=2;i++)
{
for(j=1;j<=2;j++)
{
if(i==j)
continue;
printf("\n %d %d\n",i,j);
}
}
}

do-While Loop : The  do-while loop like to be while process.( minor difference ) .The While tests the condition before executing any of the statements with in the while loop. as against this , the do-while tests the condition after having executed the statements with in the loop.

Small Program Example For Do-While Loop

While 

#include<stdio.h>
int main()
{
while(4<1)
printf("Welcome");
}

Do -while

#include<stdio.h>
int main()
{
do{
printf("welcome\n");
}
while(4<1);
}

Thanks For Visiting Welcome !! 


nested if else in c

Nested if else statement in c 

Nested if else :  An Entire if else construct within either the body of the if statement or the body of else statement. That is called as " nesting " of ifs.
nested if else alltechprograms

Program For Nested if else

#include<stdio.h>
int main(){
int x;
printf("Enter Only 1 or 2 Numbers:\n");
scanf("%d",&x);
if ( x==1)
printf("Your Enter Number is Equal to 1");
else{
if(x==2)
printf("the number is equal to 2");  
else
printf("the number is not Equal To 1 or 2");
}
}

The above Programs Can be nested if else statement process. If we enter the number is equal to 1 .it's true go to next statement printf().otherwise goes to the else statement, but here can having also if statement. The if statement is true then process to printf(). otherwise else statement is executed. 

Use of Logical Operators in Nested if else

The Logical operators are Process in Nested Else - if statement . The Logical Operator are  &&,  || ,  ! . There are read as  'AND'  'OR'  'NOT'  Respectively.

Program For Logical Operator Using Nested If else Statement in c Program  ( Percentage Problem Solve ).

#include<stdio.h>
int main()
{
int n1,n2,n3,n4,n5,n6,per;
printf("Enter The Marks in 6 Subject:\n");
scanf("%d%d%d%d%d%d",&n1,&n2,&n3,&n4,&n5,&n6);
per=(n1+n2+n3+n4+n5+n6)/6;
if(per>=60)
printf("Good Marks");
else{
if(per>=50)
printf("Average Marks");
else{
if(per>=40)
printf("Bellow Average");
else
printf("Dull");
}
}
}
Nested else if Statement  ( Another Way ) would be Like Bellow Program.
Sample Example Program
Suppose , 
if ( i==2 )                                                       if( i==2)
printf(" Hello ");                                            printf("Hello ");
else{                                                              elseif( j==2 )
if(j==2)                                                         printf("World"); 
printf(" world ");
}

Thanks For Reading More Information Nested If Else. Any Doubts Comment. Like This Post.

Saturday, 4 July 2015

if else statement in c

if else Statement in C Program

Definition Of if Statement : C Uses the keywords if  to implement the decision control instruction. The if statement like to be syntax .
if ( this condition true )
     execute statement here;

The Key of if tells the compiler time, when condition is true execute the given statement. Otherwise, Don't Perform The Operation Bellow Statement.If statement conditions like to be bellow.
if else statement
  • x==y      x is equal to y
  • x!=y       x is not equal to y
  • x<y        x is less than to y 
  • x>y        x is greater than to y
  • x<=y      x is less than or equal to y
  • x>=y      x is greater than or equal to y
Example For if Statement : 

#include<stdio.h>
int main()
{
int x;
printf("Enter The Number must be 10");
scanf("%d",&x);
if( x==10 )
printf(" x  value is %d equal to 10",x);
}

Multiple Statement in if Statement

The Multiple Statement , it may be happen that in a program .we want to be more than one statement extra to be executed . if the expression following if is satisfied. if such multiple statements are to be executed then they must be placed with in a pair of braces .

Following The Example For Multiple Statement 

#include<stdio.h>
int main()
{
int bouns,cy,yoj,yr_of_ser;
printf("Enter the Current Year and Year Of Joining ");
scanf("%d%d",&cy,&yoj);

yr_or_ser=cy-yoj;
if( yr_or_ser>3 )

{
bouns=2500;
printf("Bouns=rs %d",bouns);
}
}


if - else Statement

The if Statement , itself will execute a single statement or multiple statement . When the expression following if evaluates to true. the statement will be executed. The expression is false , the else statement will be executed. For Following Syntax and Example Bellow.

Program For if - else

#include<stdio.h>
int main()
{
int a,b,c;
printf("Enter The a and b values :");
scanf("%d%d",&a,&b);
c=a+b;
if(c==10)
{
printf("C value equal to 10");
}
else
{
printf("C Value not equal to 10");
}
}

Thanks For Reading More Information About C Programming Language Available Here !!


Wednesday, 1 July 2015

How To Disable Windows Lock Screen

Disable Lock Screen: The Lock Screen For Security Purpose Using in Computers. How To Disable Lock Screen With Out Using Any Software. Be Start , It's Simple Way Only Follow Few Steps .

  • Open Run Command ( Win+ r).
    alltechprograms
  • Type :- gpedit.msc Press Enter.
  • Computer Configuration ( Expand).
  • Administrative Templates. (Expand).
  • See Control Panel
  • Personalization 
  • See Right Side Box Don't  Display The Lock Screen.
  • Enabled Or Disable Your Choose. 
  • Set Any One. Next Click Apply Ok.
Simple Complete !! Enjoy


Picture Representation

windows lock screen

Thanks For Visiting. More Information Follows Alltechprograms.com Like And Share ..

C Basic Overview of Learn Programming Languages

What is Language:   The Language Can Be Use To " Communication Between User & Computer, in Programming Languages." Now, The Computer Which languages are Understand initial  Machine Language . The Machine Level Language Are Binary Numbers Only( 0,1).

Now a Days , So Many Languages Are Available to Designing Programs. They are Consider 4 Different Types. They Are :

  1. Machine Level Language
  2. Assembly Level Language
  3. Intermediate Level Language
  4. High-Level Language.
Follow Steps Learn Simple Way :

Step:1

Alphabets, Digits, Special Symbols.

Alphabets:-                    A,B-------Y,Z.    a,b-------y,z.
Digits:-                          0,1,2,3,4,5,6,7,8,9.
Special Symbols:-        ~  "  +  =  -  ,  <  >  {  }  %  :  ;  .  ?  \  /  !  @  #   ^  *  _  ' 

Step:2

Constants, Variables, Keywords.

1.Constants:-  There are divided into 2 types.
  • Primary Constants
  • Secondary Constants
1.Primary Constants: integer Constant, Real Constant, Char Constant.
2.Secondary Constants: Array, Pointer, Structure, Union.

1.Primary Constants

Integer :  The Integer is Simply assign values Numbers (1,2,3,4...) only. When integer Using In C Program.  Declare in int a;
int a=5;

Real Numbers: The Real Numbers are can be declare in c program like to this float f;
f=2.22;

Char:  The Char is declare in c program like to this char c;
c='a';

2.Secondary Constants

Array:The Array is Collection Of Same Data Types & Fixed Store Values.Array Can Be Declare as int age[ ];
int x;
int age[10];
age[0]=5;
age[1]=8;
age[2]=4;
     "
     "
     "
     "
age[10]=6;
Here, x is represented  Xo, X1,X2---------X9.

Pointer: The Pointer Can Be Declare as in c program like this symbol (*). The Pointer is variable, Which Contains the address in Memory of Another Variable .
<type>*<pointer name>
    int   *    p;

Structure : Structure is a Collection Variables in Under a Single name. The Structure Can Be Relatively Collection Of information in Single object.

struct student 
{
    int id;
    char name[20];
    int age;
};

Union : The Union Can Store different data types in same memory Location. Unions Provides to Effective way of Using the Same Memory for Multi-Purpose.
union data
alltechprograms{
int a;
float f;
char name[20];
};

Share Information Likes & Comments.!!!