PcTechnicalExpert

PcTechnicalExpert

You can completely customize the featured slides from the theme theme options page. You can also easily hide the slider from certain part of your site like: categories, tags, archives etc. More »

PcTechnicalExpert

PcTechnicalExpert

You can completely customize the featured slides from the theme theme options page. You can also easily hide the slider from certain part of your site like: categories, tags, archives etc. More »

PcTechnicalExpert

PcTechnicalExpert

You can completely customize the featured slides from the theme theme options page. You can also easily hide the slider from certain part of your site like: categories, tags, archives etc. More »

PcTechnicalExpert

PcTechnicalExpert

You can completely customize the featured slides from the theme theme options page. You can also easily hide the slider from certain part of your site like: categories, tags, archives etc. More »

PcTechnicalExpert

PcTechnicalExpert

You can completely customize the featured slides from the theme theme options page. You can also easily hide the slider from certain part of your site like: categories, tags, archives etc. More »

 

C Language: Inverted half pyramid using *

#include <stdio.h> int main() { int i, j, rows; printf("Enter number of rows: "); scanf("%d",&rows); for(i=rows; i>=1; --i) { for(j=1; j<=i; ++j) { printf("* "); } printf("\n"); } return 0; } OutPut: * * * * * * * *

C Language: Program to print half pyramid using alphabets

#include <stdio.h> int main() { int i, j; char input, alphabet = 'A'; printf("Enter the uppercase character you want to print in last row: "); scanf("%c",&input); for(i=1; i <= (input-'A'+1); ++i) { for(j=1;j<=i;++j) { printf("%c", alphabet); } ++alphabet; printf("\n"); }

C Language: Program to print half pyramid a using numbers

#include<stdio.h> int main() { int i, j, rows; printf(“Enter number of rows: “); scanf(“%d”,&rows); for(i=1; i<=rows; ++i) { for(j=1; j<=i; ++j) { printf(“%d “,j); } printf(“\n”); } return 0; } OutPut: 1 1 2 1 2 3 1 2 3

C Language: Program to print half pyramid using *

  #include <stdio.h> int main() { int i, j, rows; printf("Enter number of rows: "); scanf("%d",&rows); for(i=1; i<=rows; ++i) { for(j=1; j<=i; ++j) { printf("* "); } printf("\n"); } return 0; } OutPut: * * * * * * *

C Language: Factorial of a Number using For loop

The factorial of a positive number n is given by: factorial of n (n!) = 1*2*3*4….n *The factorial of a negative number doesn’t exist and the factorial of 0 is 1, i.e 0! = 1 #include <stdio.h> int main() {

C Language: Find Factorial of a Number Using Recursion

The factorial of a positive number n is given by: factorial of n (n!) = 1*2*3*4….n *The factorial of a negative number doesn’t exist and the factorial of 0 is 1, i.e 0! = 1 #include <stdio.h> long int fact(int

C Language: Find Factorial of a given Number

The factorial of a positive number n is given by: factorial of n (n!) = 1*2*3*4….n *The factorial of a negative number doesn’t exist and the factorial of 0 is 1, i.e 0! = 1 #include <stdio.h> int main() {

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

Translate »