Academic Tutorials



English | French | Portugese | Dutch | Italian
Google

Online

À la maison Codes sources E-Livres Téléchargements Nous contacter Au sujet de nous

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
CSS 1.0
CSS 2.0
HLML
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
CVS
Python
Apple Script
PL/SQL Tutorial
SQL Server
PHP
.NET (dotnet)
Microsoft.Net
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
VC++
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Photoshop Tutorial
Gimp Tutorial
Matlab
Gnuplot Programming
GIF Animation Tutorial
Scientific Visualization Tutorial
Graphics
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Weblogic Tutorial
SEO
Web Site Hosting
Domain Name
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Eclipse
J2ME
JBOSS
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Cobol
Assembly Language
Mainframe
Forth Programming
Lisp Programming
Pascal
Delphi
Fortran
OOPs
Data Warehousing
CGI Programming
Emacs Tutorial
Gnome
ILU
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills
Database Tutorials
Oracle
MySQL
Operating System
BSD
Symbian
Unix
Internet
IP-Masquerading
IPC
MIDI
Software Testing
Testing
Firewalls
SAP Module
ERP
ABAP
Business Warehousing
SAP Basis
Material Management
Sales & Distribution
Human Resource
Netweaver
Customer Relationship Management
Production and Planning
Networking Programming
Corba Tutorial
Networking Tutorial
Microsoft Office
Microsoft Word
Microsoft Outlook
Microsoft PowerPoint
Microsoft Publisher
Microsoft Excel
Microsoft Front Page
Microsoft InfoPath
Microsoft Access
Accounting
Financial Accounting
Managerial Accounting


Rapport s'embranchant dans

Previous Next




If Statement

Les programmes de langage C suit une forme séquentielle d'exécution des rapports. Beaucoup de fois on l'exige pour changer l'écoulement de l'ordre des instructions. Le langage C fournit les rapports qui peuvent changer l'écoulement d'un ordre des instructions. Ces rapports s'appellent comme ordres de contrôle. Pour sauter d'une part du programme à l'autre, ces rapports aident. Le branchement peut être sans conditions ou conditionnel. Statemnt s'embranchant sont des catégories suivantes :

  1. If Statement
  2. The If else Statement
  3. Compound Relational tests
  4. Nested if Statement
  5. Switch Statement




If Statement

Si le rapport est le plus simple former de l'ordre de contrôle. Il est très fréquemment employé en permettant l'écoulement de l'exécution du programme et de la prise de décision.

Si la structure a la syntaxe suivante

if(condition)

statement;

La commande indique que si la condition est vraie puis exécuter le rapport suivant ou si la condition est fausse l'ordinateur saute le rapport et passe à la prochaine instruction dans le programme




Le programme suivant calculent la valeur absolue d'un nombre entier en utilisant si rapport :

Calculate the absolute value of an integer */
# include < stdio.h > //Include the stdio.h file
void main ( ) // start of the program

{
int numbers; // Declare the variables
printf ("Type a number:"); // message to the user
scanf ("%d", & number); // read the number from standard input
if (number < 0) // check whether the number is a negative
number
number = - number; // If it is negative then convert it into
positive.
Printf ("The absolute value is % d \n", number); // print the value
}



Si rapport d'autre

Si est autrement réellement juste une prolongation du format général de si rapport. Si le résultat de la condition est vrai, alors le rapport 1 de programme est le rapport d'autre exécuté 2 de programme sera exécuté. La syntaxe du si le rapport d'autre est comme suit :

If (condition)

Program statement 1;
Else
Program statement 2;



La trouvaille suivante de programme si un nombre est employer négatif ou positif si rapport :

#include < stdio.h > //include the stdio.h header file in your program
void main ( ) // Start of the main
{
int num; // declare variable num as integer
printf ("Enter the number"); //message to the user
scanf ("%d", &num); // read the input number from keyboard
if (num < 0) // check whether number is less than zero.
Printf ("The number is negative") // If it is less than zero then it is negative.
Else // else statement.
Printf ("The number is positive"); //If it is more than zero then the given
number is positive.
}



Essais apparentés composés

Pour réaliser les essais apparentés composés, le langage C fournit les mécanismes nécessaires. Un essai apparenté composé est simple un ou plusieurs essais apparentés simples jointifs ensemble par le logique OU des opérateurs ou logique ET. Ces opérateurs sont représentés par le && // de paires de caractère respectivement. Pour former des expressions complexes dans C, les opérateurs composés peuvent être employés. La syntaxe des essais apparentés composés est comme suit :

a> if (condition1 && condition2 && condition3)
b>if (condition1 // condition2 // condition3)



Niché si rapport

Si le rapport peut lui-même contenir des autres si le rapport s'appelle comme niché si rapport. La syntaxe du niché si le rapport est comme suit

if (condition1)
if (condition2)
statement-1;
else
statement-2;
else
statement-3;



La copie suivante d'exemple les nombres donnés avec plus grand employer de nombre niché si rapport.

#include < stdio.h > //includes the stdio.h file to your program
main ( ) //start of main function
{
int a,b,c,big; //declaration of variables
printf ("Enter three numbers"); //message to the user
scanf ("%d %d %d", &a, &b, &c); //Read variables a,b,c,
if (a>b) // check whether a is greater than b if true then
if(a>c) // check whether a is greater than c
big = a ; // assign a to big
else big = c ; // assign c to big
else if (b>c) // if the condition (a>b) fails check whether b is
greater than c
big = b ; // assign b to big
else big = c ; // assign C to big
printf ("Largest of %d,%d&%d = %d", a,b,c,big);
}
//print the given numbers along with the largest number.



Commuter le rapport

Le rapport de commutateur-cas est un rapport de prise de décision de multi-manière. À la différence du rapport multiple de décision qui peut être employer créé si-d'autre, le rapport de commutateur évalue l'expression conditionnelle et les essais il contre les nombreuses valeurs constantes. Pendant l'exécution, la branche correspondant à la valeur que les matchs d'expression est pris.

La valeur des expressions dans une nécessité de rapport de commutateur-cas doivent être un type ordinal c.-à-d. nombre entier, char, short, long, etc. On ne permet pas le double et le flotteur.

La syntaxe du rapport de commutateur est comme suit :

switch( expression )
{
case constant-expression1: statements1;
[case constant-expression2: statements2;]
[case constant-expression3: statements3;]
[default : statements4;]
}
O/P :
#include<stdio.h>
main()
{
int n=7;

switch(n) {
case 0:
printf("You typed zero.\n");
break;
case 3:
case 5:
case 7:
printf("n is a prime number\n");
break;
case 2: printf("n is a prime number\n");
case 4:
case 6:
case 8:
printf("n is an even number\n");
break;
case 1:
case 9:
printf("n is a perfect square\n");
break;
default:
printf("Only single-digit numbers are allowed\n");
break;
}
}




Previous Next

Keywords: c branching statement, if then statement, while loop statement, for loop statement, c break statement, java statement, c tutorial, c syntax, value statement, c array, c string, c examples, example statement,


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
CSS 1.0 Quiz
CSS 2.0 Quiz
HLML Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
CVS Quiz
Python Quiz
Apple Script Quiz
PL/SQL Quiz
SQL Server Quiz
PHP Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
VC++ Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Photoshop Quiz
Gimp Quiz
Matlab Quiz
Gnuplot Programming Quiz
GIF Animation Quiz
Scientific Visualization Quiz
Graphics Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Weblogic Quiz
SEO Quiz
Web Site Hosting Quiz
Domain Name Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Eclipse Quiz
J2ME Quiz
JBOSS Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Cobol Quiz
Assembly Language Quiz
Mainframe Quiz
Forth Programming Quiz
Lisp Programming Quiz
Pascal Quiz
Delphi Quiz
Fortran Quiz
OOPs Quiz
Data Warehousing Quiz
CGI Programming Quiz
Emacs Quiz
Gnome Quiz
ILU Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz
Database Quizes
Oracle Quiz
MySQL Quiz
Operating System Quizes
BSD Quiz
Symbian Quiz
Unix Quiz
Internet Quiz
IP-Masquerading Quiz
IPC Quiz
MIDI Quiz
Software Testing Quizes
Testing Quiz
Firewalls Quiz
SAP Module Quizes
ERP Quiz
ABAP Quiz
Business Warehousing Quiz
SAP Basis Quiz
Material Management Quiz
Sales & Distribution Quiz
Human Resource Quiz
Netweaver Quiz
Customer Relationship Management Quiz
Production and Planning Quiz
Networking Programming Quizes
Corba Quiz
Networking Quiz
Microsoft Office Quizes
Microsoft Word Quiz
Microsoft Outlook Quiz
Microsoft PowerPoint Quiz
Microsoft Publisher Quiz
Microsoft Excel Quiz
Microsoft Front Page Quiz
Microsoft InfoPath Quiz
Microsoft Access Quiz
Accounting Quizes
Financial Accounting Quiz
Managerial Accounting Quiz

Privacy Policy
Copyright © 2003-2024 Vyom Technosoft Pvt. Ltd., All Rights Reserved.