Posts

Showing posts from October, 2021

PRINTING THE ALPHABET - J IN C LANGUAGE

 #include<stdio.h> #include<conio.h> // printing - J int main() {     int i,j,l=9;     for(i=1;i<=l;i++)     {         for(j=1;j<=l;j++)         {          (i==1||j==5||i==9&&j<=5||j==1&&i>5)?printf("*"):printf(" ");                                }         printf("\n");     } }

PRINTING THE ALPHABET - G IN C LANGUAGE

  #include<stdio.h> #include<conio.h> //G int main() {     int i,j,l=9;     for(i=1;i<=l;i++)     {         for(j=1;j<=l;j++)         {          (i==1||j==1||i==9||i>=5&&j==9||i==5&&j>5||j==5&&i>=5&&i<7)?printf("*"):printf(" ");                                }         printf("\n");     } }

TALK IN CLASS AND QUIZ IN CPP BY PRADEEP

 #include<iostream> #include<conio.h> using namespace std; class talk {     char name[15],name1[20],y;     int a;     public:         void dis1();         void dis2();         void dis3(); }; void talk:: dis1() {     cout<<"Hello! how are your"<<endl;     cin>>name; } void talk::dis2() {     cout<<"Ohh! nice can you tell me what's your name"<<endl;     cin>>name1; } void talk::dis3() { cout<<name1<<" you are best person in the world! \n would you like to play a Quiz reply only y or n"<<endl; cin>>y; switch (y) { case 'y':     cout<<"Ok the Quiz is started\nA.What is a correct syntax to output Hello World in C++?\n1.printf(""Hello world"")\n2.cout<<""Hello world"""<<endl;     cout<<"(note:- reply only 1 or 2)"<<endl;     cin...

POINTERS IN C LANGUAGE

 #include <stdio.h> using namespace std;    int main() {  int a;    printf(" Enter the value of a \n");    scanf("%d",&a);    int*b = &a;    printf("The value of a is %d\n",a);    printf("The value of a is %d\n",*b);    printf("The address of a is %u\n",&a);    printf("The address of a is %u", b);    }

TRIANGLE USING LOOP AND IF CONDTIONS IN C NESTE LOOP

    #include <stdio.h> int main() {     int i,j,l=9,p=5,q=5;     for(i=1;i<=l;i++)     {         for(j=1;j<=l;j++)         (i==5||j==p||j==q)?printf("*"):printf(" ");         p++,q--;      printf("\n");        }     return 0; }

PRINTING THE U ALPHABET USING C LANGUAGE

 #include <stdio.h> #include<conio.h> using namespace std;  // printing the U symbol; int main(){   int i,j,l=9; for( i=1; i<=l; i++){  for(j=1; j<=l; j++){ if(   j==1||i==9 ||j==9) printf("*");   else  printf(" ");  }  printf("\n"); }return 0; }

PRITING THE T ALPHABET IN C LANGUAGE

 #include <stdio.h> #include<conio.h> using namespace std;  // printing the T symbol; int main(){   int i,j,l=9; for( i=1; i<=l; i++){  for(j=1; j<=l; j++){ if(   j==5||i==1 ) printf("*");   else  printf(" ");  }  printf("\n"); }return 0; }

PRINTING THE L ALPHABET IN C LANGUAGE USING LOOP + IF ELSE CONDITION

 #include <stdio.h> #include<conio.h> using namespace std;  // printing the L symbol; int main(){   int i,j,l=9; for( i=1; i<=l; i++){  for(j=1; j<=l; j++){ if(   j==1||i==9 ) printf("*");   else  printf(" ");  }  printf("\n"); }return 0; }

PRINTING THE I ALPHABET IN C LANGUAGE USING LOOP AND CONDTIONS LIKE IF ELSE

 #include <stdio.h> #include<conio.h> using namespace std;  // printing the I symbol; int main(){   int i,j,l=9; for( i=1; i<=l; i++){  for(j=1; j<=l; j++){ if(   j==5||i==9||i==1 ) printf("*");   else  printf(" ");  }  printf("\n"); }return 0; }

printing the H alphabet in c language

 #include <stdio.h> #include<conio.h> using namespace std;  // printing the H symbol; int main(){   int i,j,l=9; for( i=1; i<=l; i++){  for(j=1; j<=l; j++){ if(   j==1 || j==9||i==5 ) printf("*");   else  printf(" ");  }  printf("\n"); }return 0; }

PRINTING THE ALPHABET IN C LANGUAGE USING LOOP + IF CONDITION

 #include <stdio.h> #include<conio.h> using namespace std;  // printing the F symbol; int main(){   int i,j,l=9; for( i=1; i<=l; i++){  for(j=1; j<=l; j++){ if(   j==1 || i==1||i==5 ) printf("*");   else  printf(" ");  }  printf("\n"); }return 0; }

PRINTING THE E ALPHABET IN C LANGUAGE USING LOOP+IF CONDITION

 #include <stdio.h> #include<conio.h> using namespace std;  // printing the E symbol; int main(){   int i,j,l=9; for( i=1; i<=l; i++){  for(j=1; j<=l; j++){ if(   j==1||i==9 || i==1||i==5 ) printf("*");   else  printf(" ");  }  printf("\n"); }return 0; }

PRINTING THE D ALPHABET IN C LANGUAGE USING LOOP +IF CONDITION

 #include <stdio.h> #include<conio.h> using namespace std;  // printing the D symbol; int main(){   int i,j,l=9; for( i=1; i<=l; i++){  for(j=1; j<=l; j++){ if(   j==3||i==9 || i==1||j==9 ) printf("*");   else  printf(" ");  }  printf("\n"); }return 0; }

printing the C alphabet in c language using loop +if condition

 #include <stdio.h> #include<conio.h> using namespace std;  // printing the C symbol; int main(){   int i,j,l=9; for( i=1; i<=l; i++){  for(j=1; j<=l; j++){ if(   j==1||i==9 || i==1) printf("*");   else  printf(" ");  }  printf("\n"); }return 0; }

PRINTING THE B ALPHABET IN C LANGUAGE

 #include <stdio.h> #include<conio.h> using namespace std;  // printing the B symbol; int main(){   int i,j,l=9; for( i=1; i<=l; i++){  for(j=1; j<=l; j++){ if(i==5 || j==1 ||j==9||i==9 || i==1) printf("*");   else  printf(" ");  }  printf("\n"); }return 0; }

ENTER STUDENT MARKS AND SEE THE RESULT IN PERCENTAGE IN JAVA

import java.util.Scanner; public class Main { public static void main(String[] args) {     Scanner sc = new Scanner(System.in);     System.out.println( " Enter your math subject number ");          int a = sc.nextInt();     System.out.println( " Enter your chemistry subject number ");     int b = sc.nextInt();     System.out.println( " Enter your physics  subject number ");     int c = sc.nextInt();     System.out.println( " Enter your english subject number ");     int d = sc.nextInt();     System.out.println( " Enter your hindi subject number ");     int e = sc.nextInt();          float result = (a+b+c+d+e)/5 ;      System.out.println(" The result is "+ result + "%"); } }

A SIMPLE EXAMPLE OF ARRAYLIST IN JAVA

 import java.util;  // (//)  this is called single line comment which will ignore that //what you are saying it is a way to tell to the people so that //they can understand the code  like I am making you //understanding  //import java.util.*; you can write like this   public class ArrayListExample1{    public static void main(String args[]){     ArrayList<String> list = new ArrayList<String>();//Creating arraylist           list.add("Mango");//Adding object in arraylist           list.add("Apple");           list.add("Banana");           list.add("Grapes");           //Printing the arraylist object          System.out.println(list);    }   }  

FIND THE LARGEST NUMBER USING CLASS IN CPP

  #include <iostream>   using   namespace  std;        class   set {        int  m,n;        public:        void  inputdata() ;                void  largest() ;       };        void  set::inputdata(){       cout<< "enter the value of m and n:" <<endl;       cin>>m;       cin>>n;       } ;        void  set::largest(){       if(m>=n){           cout<< "largest=" <<m<<endl;    ...

PERSONALITY MAN'S WHAT IS THE ACTUAL WORD FOR QUALITY OF A PERSON

 craftsman -  who writes something on the wall. only writes.  artisan      -  who makes a house. only makes a house not write something on the wall.

SHOPPING LIST BY C++ PROGRAMMING LANGUAGE

 // ******Refereced by a book that is E- balagurusamy . i got it from library****** #include <iostream> using namespace std; const int m = 100; class items { private:   int itemcode[m];   float itemprice[m];   int count; public:   void cnt (void)   {     count = 0;   }   void getitem (void);   void displaysum (void);   void remove (void);   void displayitems (void); }; void items::getitem (void) {   cout << "Enter item code: ";   cin >> itemcode[count];   cout << "Enter item cost:";   cin >> itemprice[count];   count++; } void items::displaysum (void) {   float sum = 0;   for (int i = 0; i < count; i++)     sum = sum + itemprice[i];   cout << "total value: " << sum << endl; } void items::remove (void) {   int a;   cout << "Enter item code: ";   cin >> a;   for (int i = 0; i < count; i++) ...

ARRAY PLAY USING FOR LOOP IN JAVA

  public class Main { public static void main(String[] args) {     int arr[]={1,3,45,56};     int sum = 0 ;     for(int i=0; i<4; i++)     {        //System.out.println(arr[i]);         sum = sum+(arr[i]);        System.out.println(sum);     } } }

SUM USING FOR LOOP SUM OF ALL EVEN NUMBERS

   #include <iostream> using namespace std; int main() {    int sum = 0;      for( int i = 0; i<=90; i= i+2 ){          cout<<i<<endl;         //  cout<<i<<endl;          sum = sum + (i);      }       cout<<"the sum is "<<sum<<endl;     return 0; }

ARRAY USING FOR LOOP

   #include <iostream> using namespace std; {     int marks[]= {1,3,4,5};     int mathmarks[4];     // mathmarks[0]=478957345;     // mathmarks[1]= 789;     // mathmarks[2]=785;     // mathmarks[3]=787;                    for(int i = 0; i<4; i++){         cout<<marks[i]<<endl;     }     // for(int i = 0; i<4; i++){     //     cout<<mathmarks[i]<<endl;     // }             return 0; }

FIND LARGEST NUMBER USING TERNARY OPERATOR IN CPP

    #include <iostream> using namespace std; int main() { int a,b,c,highest; cout<<"enter your first  numbers "<<endl; cin>>a; cout<<"enter your second numbers"<<endl; cin>>b; cout<<"enter your third numbers "<<endl; cin>>c;  highest = (a>b&&a>c?a:b>c?b:c);     cout<<"your highest number is "<<highest<<endl;     return 0; } THIS IS BUT FOR  FIND LARGEST NUMBER OUT OF FOUR NUMBERS    #include <iostream> using namespace std; int main() { int a,b,c,d,highest; cout<<"enter your first  numbers "<<endl; cin>>a; cout<<"enter your second numbers"<<endl; cin>>b; cout<<"enter your third numbers "<<endl; cin>>c; cout<<"enter your fourth numbers "<<endl; cin>>d;  highest = (a>b && a>c && a>d ?a: b>c && b>d ?b: ...

HOW MAKE A TABLE IN CPP USING FOR LOOP

 // TRY KARO  #include <iostream> #include<conio.h> using namespace std; int main () {   long int n;   cout << " you don't the table of 6836586483658 just enter your number " <<     endl;   cin >> n;   for (long int i = 1; i <= 10; ++i)     {       cout << n << "*" << i << "=" << n * i << endl;     }   cout << "Any othe kind you want to know just enter a number  " << endl;   cin>>n;   for (long int i = 1; i <= 10; ++i)     {       cout << n << "*" << i << "=" << n * i << endl;     } getch();   return 0; }

FIND SUM AND AVERAGE IN CPP

 #include <iostream> using namespace std; int main() { int sum , average ; int number1,number2;     cout<<"enter your first number "<<endl; std::cin >>number1;  cout<<"enter your second number"<<endl; cin>>number2;  sum = number1+number2; average = sum/2; cout<<"the sum is "<<sum<<endl; cout<<"the average is "<<average;   return 0; }

check the leap is or not a leap year in cpp

 // checked that year is leap or not  #include<iostream> using namespace std; int main(){     int year ;     cout<<" enter your year "<<endl;     cin>>year;     if (year%4==0)     cout<<"your year is leap year "<<endl;          else     cout<<"your year is not a leap year "<<endl;     return 0; }

create a swaping two number using multiply operator in cpp

 #include <iostream>   using namespace std;   int main()   {   int a=50, b=60;       cout<<"Before swap a= "<<a<<" b= "<<b<<endl;       a=a*b;        //a=50 (5*10)     b=a/b;        //b=5 (50/10)     a=a/b;        //a=10 (50/5)     cout<<"After swap a= "<<a<<" b= "<<b<<endl;       return 0;   }  

PRINT COLLEGE STUDENT DETAIL IN ONE CLICK

  /****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,  C#, VB, Perl, Swift, Prolog, Javascript, Pascal, HTML, CSS, JS Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include <stdio.h> #include<iostream> using namespace std; int main() {   int a; cout<< "Enter last 4 digit of your enrollment "; cin >>a; if(a==1017) cout<<"your name is dheeraj\nyour father name is mr.Bhagirat paswan \n and your date of birth is 7/7/2001 "; else if (a==1002)  cout<<"your name is Adity Davande \nyour fathe namer is Promod dawande\nyour from BIRT"; else if (a==1003) cout<<"your enrollment is 0173CS201003 \nyour name is altmash khan \nyour father name is Ashif khan\nyou are for BIRT"; else if  (a==1004) c...

S SIZE ,X,XL, BANKINNG SYSTEM MANANGEMENT IN CPP

  #include <stdio.h>  #include <stdlib.h> int main() {     int select, csize, wsize,count;     count=1;     while(count>=1)     {         printf(" __________________________________\n");         printf("|<<<<< SELECT ANYONE OF THEM >>>>>>|\n");         printf("| 1. Buying T-shirt                |\n");         printf("| 2. Buying Pant                   |\n");         printf("| 3. Buying both Pant & T shirt    |\n");         printf("| 4. About This Software           |\n");         printf("| 5. Exit                          |\n");         p...

SWAPING OF TWO NUMBERS IN CPP PROGRAM

   #include <iostream> using namespace std; int main() {     string a= "lakshman";     string b = "malviya";     string c;     c=a;     a=b;     b=c;     cout<<"swaping strings :"<<endl;     cout<<"first is "<<a<<endl;     cout<<"second is "<<b<<endl;           return 0; }

ENTER THREE NUMBER AND FIND THE LARGEST NUMBER BETWEEN ALL OF THEM

 #include<iostream> using namespace std; int main () {   int a, b, c, big;   cout << " Enter your first number " << endl;   cin >> a;   cout << " Enter your second number " << endl;   cin >> b;   cout << " Enter your third number " << endl;   cin >> c;   if (a > b && a > c)     {       cout << "your largest number is " << endl;       cout << a;     }   else if (b > a && b > c)     {       cout << "your largest number is " << endl;       cout << b;     }   else     {       cout << "your largest number is " << endl;       cout << c;     }   return 0; }