









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
These are the Lecture Slides of C Programming which includes Sscanf() Function, Snprintf() Function, Converts String, Floating Point Value, Searches for First Occurrence, Number of Characters, Token Separators, Value of Zero Means etc. Key important ponts are: Control Statements in C, C Keywords, Words in Bold Print, Sequential Execution, Assignment Statements, Function Block, Block of Statements, Single Statement, Performing Infinite Loop
Typology: Slides
1 / 16
This page cannot be seen from the preview
Don't miss anything!










auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while
The words in bold print are used in control statements. They change the otherwise sequential execution of the assignment statements in a function block
const int MAX_BINS = 11; int orderNumber; int binNumber;
printf("Enter order number: "); scanf("%d", &orderNumber); binNumber = orderNumber % MAX_BINS; printf("Bin number is %d\n", binNumber); }
if (aNumber != 1000) countA++;
if (aValue <= 10) { printf("Answer is %8.2f\n", aValue); countB++; } // End if else { printf("Error occurred\n"); countC++; } // End else
if (aValue == 1) countA++; else if (aValue == 10) countB++; else if (aValue == 100) countC++; else countD++;
while (aResult >= 1000) { aResult = aResult / aValue; printf("Result is %9.4f\n", aResult); } // End while
aResult = MAX_VALUE;
while (aResult >= 1000) { countW++;
// nested if statement if (aValue == 1) countA++; else if (aValue == 10) countB++; else if (aValue == 100) countC++; else countD++; aResult = aResult / aValue; } // End while
for (i = 1; i <= MAX_LENGTH; i++) printf("#");
for (i = 0; i < MAX_SIZE; i++) { printf("Symbol is %c\n", aBuffer[i]); if (i > 0) aResult = aResult / i; } // End for
switch (aNumber) { case 1 : countA++; break; case 10 : countB++; break; case 100 : case 500 : countC++; break; default : countD++; } // End switch