Skip to main content

Posts

Showing posts from December, 2018

WAP to generate the following pattern in C

WAP to generate the following pattern   n=4  4444    i=4  333      i=3  22       i=2  1        i=1  #include<stdio.h> #include<conio.h> main( ) {             int i,j,n;             clrscr();             printf("\nEnter the value of n:");             scanf("%d",&n);             for(i=n;i>=1;i--)             {                         for(j=1;j<=i;j++)      ...

WAP to generate the following pattern using for loop in C

WAP to generate the following pattern   n=4   1  22   333 4444  #include<stdio.h> #include<conio.h> main( ) {             int i,j,n,sp;             clrscr();             printf("\nEnter the value of n:");             scanf("%d",&n);             sp=n-1;             for(i=1;i<=n;i++)             {                         for(j=1;j<=sp;j++)         ...

WAP to read the value of n and generate the following pattern using for loop in C

/* WAP to read the value of n and generate the following  pattern    n=4   1234  123 12 1   #include<stdio.h> #include<conio.h> main() {             int i,j,n;             clrscr();             printf("\nEnter the value of n:");             scanf("%d",&n);             for(i=n;i>=1;i--)             {                         for(j=1;j<=i;j++)                   ...

WAP to read the value of n and generate the following pattern using for loop in C

WAP to read the value of n and generate the following pattern   n=4   1   12   123   1234 */ #include<stdio.h> #include<conio.h> main() {             int i,j,n;             clrscr();             printf("\nEnter the value of n:");             scanf("%d",&n);             for(i=1;i<=n;i++)             {                         for(j=1;j<=i;j++)                ...

WAP to read the value of n and generate the following pattern in c using for loop

WAP to read the value of n and generate the following pattern using for loop in C.   n=4   ****   ***  **   * #include<stdio.h> #include<conio.h> main() {             int i,j,n;             clrscr();             printf("\nEnter the value of n:");             scanf("%d",&n);             for(i=n;i>=1;i--)             {                         for(j=1;j<=i;j++)               ...

WAP to read the value of n and generate the following pattern using for loop in c

WAP to read the value of n and generate the following pattern in C using for for loop.  n=4   *           i=1   **          i=2   ***        i=3   ****      i=4           */ #include<stdio.h> #include<conio.h> main() {             int i,j,n;             clrscr();             printf("\nEnter the value of n:");             scanf("%d",&n);             for(i=1;i<=n;i++)             {           ...

WAP to Find x to power y in C

Write a 'c' program to read the value of x and y and find x to power y ?             e.g.                         x=5      y=3                                     Result = 5^3=5*5*5=125   */   #include<stdio.h>   #include<conio.h>   main( )   {             int x,y,i,result;             clrscr();             printf("\nEnter the value of x and y :");           ...

For loop in C and C++

For loop Structure in C and C++ For Loop : - In for loop first we give the initial value and then.it checks the condition if the condition is true then it enters the loop and execute all the statement inside the curly braces and after this it go to the third part that is increment/ decrement . And it again checks the conditions. In this way it runs till the condition is true. When the condition becomes false it come out of the loop. .   Syntax   for( Initialization ; Condition  ;  Increment/ decrement ) { body of the loop }   EX for(i=0;i<=10;i++) { /**************************/ } c programming language,c programming software,c programming download,c programming online,c programming examples,c programming tutorial,c programming code c programming w3schools,c++ compiler download,turbo c compiler,online c compiler,c compiler for windows,c++ compiler,online compiler online c++ compiler,gdb compiler,c pro...