Breaking

Showing posts with label All C program. Show all posts
Showing posts with label All C program. Show all posts
April 12, 2019

String conversation





#include<stdio.h>
#include<string.h>
void main()
{
    char name[22],b,c=65,s=97,d,f;
    int i,j;

    printf("Enter a character :");
    scanf("%s",name);

    for(i=0; i<123;i++)
    {   
        d=0;
        f=0;
        f=s;
        d=c;
        for(j=0; j<strlen(name); j++)
        {
            if(name[j]==d)
            {
                name[j]=d+32;       
            }
            else
            {
                if(name[j]==f)
                {
                     name[j]=s-32;
                }
            }
         }
          if(c<97 && s>65)
          {
             c++;
             s++;
          }
   
     }
   for(i=0; i<strlen(name);i++)
   {
       printf("%c",name[i]);
   }
}
   
learn hack swain

April 09, 2019

Write a program to assending order the string



Write a program to assending order the string.

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct a
{
char name[20];
}s[5];
void main()
{
           int i,j,a,b;
           char n[22];

for(i=0; i<5; i++)
{
         printf("Enter a character  :");
         scanf("%s",s[i].name);
}

for(i=0; i<5; i++)
{
       for(j=0; j<4; j++)
       {
              if(strcmp(s[i].name,s[j].name)<-1)
              {
                      strcpy(n,s[i].name);
                      strcpy(s[i].name,s[j].name);
                      strcpy(s[j].name,n);
              }
      }
}

  for(i=0; i<5; i++)
  {
         printf("\nEnte :%s",s[i].name);
   }
}




learn hack swain

January 17, 2019

C program



in the bellow you can also seen and download the programs file



the solution is here







#include<stdio.h>
#include<stdlib.h>
void main()
{
system("clear");   //  clear screen
int a[10][10],b[10][10],c[10][10],r1,c1,r2,c2,i,j,k;

    printf("\n Enter a number of first row ");
    scanf("%d",&r1);

    printf("\n Enter a number of first collimn      ");
     scanf("%d",&c1);

printf("\n \n enter a numbe of first matrix \n");

for(i=0; i<r1; i++)
{
       for(j=0; j<c1; j++)
       {
              scanf("%d",&a[i][j]);
       }
}
     printf("Enter a row of second matrix ");
     scanf("%d",&r2);

      printf("Enter a  collinm of second           matrix");
    scanf("%d",&c2);

for(i=0; i<r2; i++)
{
       for(j=0; j<c2; j++)
       {
             scanf("%d",&b[i][j]);
       }
}

system("clear");

printf("\n\n entered a element of first matrix \n\n ");

for(i=0; i<r1; i++)
{
        for(j=0; j<c1; j++)
       {
              printf("\t%d",a[i][j]);
        }
        printf("\n");
}

printf("\n\n ENtered a element of aecond matrix \n\n");

for(i=0; i<r2; i++)
{
        for(j=0; j<c2; j++)
        {
               printf("\t%d",b[i][j]);
        }
printf("\n");
}
printf("\n\n Addition of two matrix\n\n");

for(i=0; i<r1; i++)
{
        for(j=0; j<c1; j++)
        {
               printf("\t%d",a[i][j]+b[i][j]);
        }
       printf("\n");
 }
printf("\n\n Matrix substration \n\n");

for(i=0; i<r1; i++)
{
        For(j=0; j<c1; j++)
         {
              printf("\t%d",a[i][j]-b[i][j]);
         }
         printf("\n");
}
printf("\n\n Multiply of two matrix \n\n");

 for(i=0; i<r1; i++)
{
         for(j=0; j<c1; j++)
         {
               c [i][j]=0;
               for(k=0; k<c1; k++)
               {
                      c[i][j] +=a[i][k]*b[k][j];
                }
         }
}

for(i=0; i<r1; i++)
{
        for(j=0; j<c1; j++)
        {
              printf("\t%d",c[i][j]);
        }
            printf("\n");
}

}



CLICK HERE TO DOWNLOAD THE PROGRAMS FILE





my hindi article








January 17, 2019

C program





In the bellow you can seen and download the file


The solution is here  👇👇 



#include<stdio.h>
#include<stdlib.h>
void main()
{
   system("clear");     // clear screen
      int a[10][10],b[10][10],c[10]                    [10],r1,c1,r2,c2,i,j,k;



    printf("\n Enter a number of first row ");
    scanf("%d",&r1);

    printf("\n Enter a number of first colloumn");
scanf("%d",&c1);

printf("\n \n enter a elements of first matrix \n");

for(i=0; i<r1; i++)
{
       for(j=0; j<c1; j++)
       {
            scanf("%d",&a[i][j]);
       }
}

//   Above is first  matrix elements  


printf("Enter a row of second matrix ");
scanf("%d",&r2);

printf("Enter a  collinm of second matrix");
scanf("%d",&c2);

for(i=0; i<r2; i++)
{
      for(j=0; j<c2; j++)
      {
           scanf("%d",&b[i][j]);
      }
}

system("clear");     // clear screen

printf("\n\n entered a element of first matrix \n\n ");   // element  print

for(i=0; i<r1; i++)
{
      for(j=0; j<c1; j++)
      {
            printf("\t%d",a[i][j]);
      }
printf("\n");
}

printf("\n\n ENtered a element of second matrix \n\n");     //print second matrix

for(i=0; i<r2; i++)
{
       for(j=0; j<c2; j++)
       {
             printf("\t%d",b[i][j]);
       }
printf("\n");
}

printf("\n\n Multiply of two matrix \n\n");
for(i=0; i<r1; i++)
{
        for(j=0; j<c1; j++)
        {
                c[i][j]=0;
               for(k=0; k<c1; k++)
               {
                       c[i][j] +=a[i][k]*b[k][j];
               }
       } 
}

for(i=0; i<r1; i++)
{
       for(j=0; j<c1; j++)
       {
              printf("\t%d",c[i][j]);
       }
      printf("\n");
}





CLICK HERE TO DOWNLOAD THE PROGRAMS FILE





my hindi article










December 30, 2018

how to find middle number between three number



Solutions is here 👇👇


#include<stdio.h>
#include<conio.h>
void main()
{clrscr();
int a,b,c;

printf("enter a number a");
scanf("%d",&a);
printf("enter a number for b");
scanf("%d",&b);
printf("enter a number for c");
scanf("%d",&c);
if(a>b)
{if(a<c)
{
printf(" a is middle ");
}
else
{if(b>c)
{
printf(" b is middle ");
}
else
{
printf(" c is middle ");
}
}
}
else
{
if(b<c)
{
printf(" b is middle ");
}
else
{
if(a>c)
{
printf(" a is middle ");
}
else
{
printf(" c is middle ");
}
}
}
getch();
}




December 30, 2018

palindrome program in c

Solution is here 👇👇


#include<stdio.h>
#include<conio.h>
void main()
{clrscr();
int a,rev=0,b,rem=0;


printf(" enter a number of a ");
scanf("%d",&a);
b=a;
while(b!=0)
{
  rem=b%10;
  rev=rev*10+rem;
  b=b/10;
}
if(a==rev)
{
  printf("%d is pelindrom number",a);
}
else
{
  printf("%d is not a pelindrom number",a);
}

       getch();
       }


December 30, 2018

All C program



Solution is here 👇👇

#include<stdio.h>
#include<conio.h>

void main()
{
  clrscr();

  int rem=0,a,b,rev=0;
printf("enter a number ");
scanf("%d",&a);
b=a;
while(b!=0)
{
  rem=b%10;
  rev=rev+rem*rem*rem;
  b=b/10;

}
if(a==rev)
{
   printf("%d is a amstrong number",a);
}
else
{
  printf("%d is not a amstrong number",a);
}

getch();
}
December 27, 2018

All C program



The solution is here 👇👇

#include<stdio.h>
void main()
{
int i,j;
int a=65;
printf("A");

for(i=2; i<6; i++)
{
      printf("\n");
      a=64;
       for(j=a+i; j<a+i*2; j++)
       {
              printf("%c",j);
       }

}
}





#include

int main()
{
    printf("Hello world!");
    return 0;
}
December 27, 2018

All C program


The solution is here 👇👇



#include<stdio.h>
#include<stdlib.h>
void pin();
void balance();
void withdrow();
void transfer();
void deposite();
int ch;
char name[20];
int pincode,with,che,tra,depo,bal=10000;
int a;
void main()
{
system("clear");
pin();
}
void pin()
{
b:
printf("enter your pin= ");
scanf("%d",&pincode);
system("clear ");
if(pincode==100)
{                            
printf("\n                                                          >>>>> HELLO SIR WELL COME  TO OUR OFFICIAL BANK<<<<<\n\n\n");
printf("\n                                                                                                                     ifs any problem  than tap 5");

printf("\nenter your choice \n");

x:
if(a==1)
system("clear");
printf("\n\n1.. Check your balance");
printf("\n\n2.. Withdrow your balance");
printf("\n\n3.. Transfer your balance");
printf("\n\n4.. Deposite your balance");
printf("\n\nopction is :->");
scanf("%d",&ch);

switch(ch)
{

case 1:
{
system("clear");
balance();
printf(" \n \n do you want to again than tap 1= ");
scanf("%d",&a);
if(a==1)
{
goto x;
}
printf("\n\n");
}break;
case 2:
{
system("clear");
withdrow();
printf(" \n \n do you want to again than tap 1= ");
scanf("%d",&a);
if(a==1)
{
goto x;
}
printf("\n\n");
}break;
case 3:
{
system("clear");
transfer();
printf(" \n \n do you want to again than tap 1= ");
scanf("%d",&a);
if(a==1)
{
goto x;
}
printf("\n\n");
}
case 4:
{
system("clear");
deposite();
printf(" \n \n do you want to again than tap 1= ");
scanf("%d",&a);
if(a==1)
{
goto x;
}
printf("\n\n");
}
case 5:
{
printf("\n\n THANK YOU TO USE OUR SERVECE\n\n\n");
}
}



}
else
{
printf("\nplease enter vaild pincide\n");
goto b;
}
}//    main pin void
void balance()
{
system("clear");
printf("\n \n sir, your balance is %d\n\n",bal);
}
void withdrow()
{
system("clear");
printf("enter a amount to withdrow :->");
scanf("%d",&with);
printf("\n withdrow is sucsess full");
printf("\n\n sir, your curent balance is :-> %d",bal=bal-with);
}
void transfer()
{
system("clear");

printf("\n\nenter a user name :->");
scanf("%s",name);
printf("enter a amount to transfer :->");
scanf(" %d",&tra);
printf("\n the amaount is sucsessfull to transfer Name= (%s) ",name);
printf("\n        Amount= (%d) ",tra);
printf("\n\n sir, your current balance is :-> %d",bal=bal-tra);
}
void deposite()
{
system("clear");
printf("\n enter a amount to deposite :->");
scanf("%d",&depo);
printf("\nsir, deposite is sucsessful the amount is :-> %d",depo);
printf("\n\n sir, your curent balance is :->%d",bal=bal+depo);
}








December 27, 2018

All C program


        The  solution  is  here 👇👇

 #include<stdio.h>
 #include<conio.h>
void main()
{
clrscr();

   int i,a=2,b=3,c=4;
  for(i=1; i<11; i++)
{
     printf("\n");
     printf("%d * %d = %d",a,i,a*i);
      printf("\t %d * %d = %d",b,i,b*i);
      printf("\t %d * %d = %d",c,i,c*i);

}
getch();
}