Skip to main content

Posts

Showing posts with the label for loop in c

101/Introduction to C Language - part 2

To get an overview of C language read:  101/Introduction to C - part 1 Following are some basic topics which we will cover in this tutorial: How to take input from the users ( Managing Input and Output operation). How to take decisions (Decision making and Branching). ie. If-else and nested If-else Looping:  for loop, nested for loop, while/do while loop. Arrays. How to take input from the user in C Following are the two ways to take input from the user Using normal input syntax Taking input as command line argument 1. Using normal input syntax In C programming, scanf() function is used to read character, string,  numeric data from keyboard. It uses format specifier as parameter to take type of input like ‘ %s ’ for string , ‘ %d ’ for interger , ‘%c ’ for character . Example:  #include<stdio.h> int main() { int i; printf("Enter any Number:"); //taking Integer input from the user and storing at the address of v...