April 23, 2019

Is it still active or not

Hey guys how are you all this is the first blog of Techtro which is now a leading ngo regarding football, Techtro is now a brand promoting football in India,
Well today we are not talking about any technology related post today we will try to get how many of you still there with Techtro.

So guys share with all your friend and make our reach enormous. If you will succeed in that i promise i will write about the journey of Techtro, how this becomes a brand. A hard struggle of Neeraj and his team to get this mark.
Thankyou

August 4, 2016

Bike Stunt Virtual vs Reality

Diamond Pattern

Diamond  Pattern 

#include<iostream.h>
#include<conio.h>
void main()
{
 clrscr();
 int i,j,n,k;
 cin>>n;          /* Enter Odd No. Only*/
 for(i=0;i<n;i+=2)
 {
  for(j=0;j<n-i;j++)
  {
  cout<<" ";
  }
  for(k=1;k<i;k++)
  {
  cout<<" *";
  }
  cout<<endl;
  }
  for(i=0;i<n;i+=2)
  {
  for(j=1;j<=i;j++)
  {
  cout<<" ";}
  for(k=0;k<n-i;k++)
  {
  cout<<"* ";
  }
  cout<<endl;
  }
  getch();
  }

Calculating temperature in Celcius or Fahrenheit

Calculating temperature in Celsius or Fahrenheit

#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
double t,ct,choice;
cout<<"Temperature Conversion Menu"<<"\n";
cout<<"1. Fahrenheit to Celsius"<<"\n";
cout<<"2. Celsius to Fahrenheit"<<"\n";
cout<<"Enter choice (1-2):\t";
cin>>choice;
if (choice==1)
 { cout<<"\n"<<"Enter temperature in Fahrenheit:\t";
   cin>>t;
   ct=(t-32)/1.8;
   cout<<"Temperature in Celsius is "<<ct<<"\n";
 }
 else
 { cout<<"\n"<<"Enter temperature in Celsius:\t";
  cin>>t;
  ct=(1.8*t)+32;
  cout<<"Temperature in Fahrenheit is  :\t"<<ct;
 }
getch();
}

Example of Switch Statement

Example of Switch Statement

#include<iostream.h>
#include<conio.h>
void main()
{
 clrscr();
 float a,b,r;
 char ch;
 cout<<"Enter First Number :\t";
 cin>>a;
 cout<<"Enter Second Number :\t";
 cin>>b;
 cout<<"Enter operator (+,-,*,/,%) :\t";
 cin>>ch;
 cout<<"\n";
 switch (ch)
 {
  case '+': r=a+b;
        cout<<"\n Adding :\t"<<r;
        break;
  case '-': r=a-b;
        cout<<"\n Subtracting :\t"<<r;
        break;
  case '*': r=a*b;
        cout<<"\n Multipling :\t"<<r;
        break;
  case '/': if(b==0)
        cout<<"\nDivide by ZERO";
        else
        r=b/a;
        cout<<"\n Dividing :\t"<<r;
        break;
  case '%': if(b==0)
        cout<<"\nDivide by ZERO";
        else
        {
         int res,q;
         q=b/a;
         res=b - (q*a);
         res=r;
         cout<<"\n Modulus :\t"<<r;
         }
         break;
  default : cout<<"\nCheck your CHOICE";
  }
  getch();
 }

Prime Number

Prime Number

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int flag=1,num,i;
cin>>num;
for(i=2;i<num;i++)
  {
    if(num%i==0)
      { flag=0;break;}
  }
  if(flag==1)
  cout<<"\nPrime";
  else
  cout<<"\nNot Prime";
  getch();
  }

Disqus Shortname

Comments system