TO PRINT ALPHABET PYRAMID
ABCDEFGGFEDCBA
ABCDEFFEDCBA
ABCDEEDCBA
ABCDDCBA
ABCCBA
ABAB
A
#include
#incldue
int main( )
{
int r,c,askey,sp;
clrscr( );
for( r=7; r>=1; r-- )
{
for(sp=6; sp>=r; sp--)
printf(" "); //2 spaces
askey=65;
for(c=1; c<=r; c++ )
printf("%2c", askey++ );
for(c=r-1; c>=1; c-- )
printf("%2c", --askey);
printf("\n");
}
getch();
return 0;
}
by BRAMHA VARDHAN
import java.io.*; public class Jerry { public static void main(String as[]) throws IOException { int k=Integer.parseInt(as[0]); int n=k; int d=0,s=0; while(n>0) { d=n%10; s=s+(d*d*d); n=n/10; } if(k==s) System.out.println("Armstrong number"); else System.out.println("not Armstrong number"); } }
* * * * * * * * * * write the c++ program and show me brifily?
By using those two functions in your code.
Write a program to convert a 2-digit BCD number into hexadecimal
i cant write
One.int main (void) { return 0; }
Functions are very important in C++, as you can't write the simplest program to print hello without using a function. Overall you can say that function are building blocks of a C++ program. Functions can also be defined by the programmer to reduce program size.
trytytytytytytytytrf 6 bcvvtgujhy6
WRITE A PROGRAM TO CONVERT A 2-DIGIT bcd NUMBER INTO HEXADECIMAL
import java.io.*; class Armstrong { public static void main()throws IOException { BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter a number"); int a=Integer.parseInt(in.readLine()); int n1=a,rev=0,d=0; while(a!=0) { d=a%10; rev=rev+d*d*d; a=a/10; } if(rev==n1) System.out.println("It is a armstrong number "); else System.out.println("It is not a armstrong number "); } }
You can use Java's built-in functions to write a code that will find multilingual languages.
Classes are well organised functions in java which help discriminate between two different functions.