Daily Archives: December 31, 2016

C Language: Program to Find the Largest Number Among Three Numbers

Example:1 The below program uses “If statement” to find the Largest Number Among Three Numbers: #include <stdio.h> int main() { int n1, n2, n3; printf(“Enter three numbers: “); scanf(“%d %d %d”, &n1, &n2, &n3); if( n1>=n2 && n1>=n3 ) printf(“%d

C Language: SwapTwo Numbers

#1: Program to Swap Numbers Using Temporary Variable: #include <stdio.h> int main() { int a,b,tem; printf(“Enter first number: “); scanf(“%d”, &a); printf(“Enter second number: “); scanf(“%d”,&b); printf(“\n Before swapping,a= %d\n”,a); printf(“Before swapping, b= %d”,b); // Value of a is assigned

C Language: About Input/output functions

C has inbuilt library functions to perform input and output operations/task. The commonly used I/O (Input/Output) functions are Printf() and scanf(). Here Scanf() function reads the formatted input from standard input(i.e keyboard) where as Printf() function sends the formatted output

C Language: “Hello, World!” Program

Program to Display “Hello, World!” #include <stdio.h> int main() { // printf() displays the string inside quotation printf(“Hello, World!”); return 0; } Output: Hello, World!

Translate »