Tic-Tac Toe Game using C Programming

Posted by Tushar Bedekar

/* A simple Tic Tac Toe game. */

#include <stdio.h>
#include <stdlib.h>

char matrix[3][3];                   /* the tic tac toe matrix */       
char check(void);
void init_matrix(void);
void get_player_move(void);
void get_computer_move(void);
void disp_matrix(void);
int main(void)
{
char done;
printf("This is the game of Tic Tac Toe.\n");
printf("You will be playing  against the computer.\n");
done = ' ';
init_matrix();
do{
disp_matrix();
get_player_move();
done = check();                                                               /* see if winner */
if(done!= ' ') break;                                                       /* winner!*/
get_computer_move();
done = check();                                      /* see if winner */
} while(done== ' ');
if(done=='X') printf("You won!\n");
else printf("I won!!!!\n");
disp_matrix();                                          /* show final positions */
return 0;
}

/* Initialize the matrix. */

void init_matrix(void)
{
int i, j;
for(i=0; i<3; i++)
for(j=0; j<3; j++) matrix[i][j] = ' ';
}

/* Get a player's move. */

void get_player_move(void)
{
int x, y;
printf("Enter X,Y coordinates for your move: ");
scanf("%d%*c%d", &x, &y);
x--; y--;
if(matrix[x][y]!= ' '){
printf("Invalid move, try again.\n");
get_player_move();
}
else matrix[x][y] = 'X';
}

/* Get a move from the computer. */

void get_computer_move(void)
{
int i, j;
for(i=0; i<3; i++){
for(j=0; j<3; j++)
if(matrix[i][j]==' ') break;
if(matrix[i][j]==' ') break;
}
if(i*j==9) {
printf("draw\n");
exit(0);
}
else
matrix[i][j] = 'O';
}

/* Display the matrix on the screen. */

void disp_matrix(void)
{
int t;
for(t=0; t<3; t++) {
printf(" %c | %c | %c ",matrix[t][0],
matrix[t][1], matrix [t][2]);
if(t!=2) printf("\n---|---|---\n");
}
printf("\n");
}

/* See if there is a winner. */

char check(void)
{
int i;
for(i=0; i<3; i++)                                                    /* check rows */
if(matrix[i][0]==matrix[i][1] &&
matrix[i][0]==matrix[i][2]) return matrix[i][0];
for(i=0; i<3; i++)                                                   /* check columns */
if(matrix[0][i]==matrix[1][i] && matrix[0][i]==matrix[2][i])
    return matrix[0][i];
/* test diagonals */
if(matrix[0][0]==matrix[1][1] &&
matrix[1][1]==matrix[2][2])
return matrix[0][0];
if(matrix[0][2]==matrix[1][1] &&
matrix[1][1]==matrix[2][0])
return matrix[0][2];
return ' ';
}


Download Game:-

                                                           


Read More

Best Antivirus Apps for Android Free Download

Posted by Tushar Bedekar

Antivirus Security – FREE (AVG) Antivirus App

AVG is the best android anti virus. Because Apart from combating viruses and malware, it also provides anti-theft and privacy protection. It has a very efficient virus scan and virus detection engine that will flag viruses as they try to get into your device. Its web surfing protection feature will guarantee your online security. Its trial period is only limited to 14-days. This antivirus software app apk can be download from official website.

Tushar

                                                                                                                      

Avast Mobile Security Antivirus App

Avast is an amazing security application with a good review that transcends beyond the basic anti-malware protection and offers among others an app manger, call and SMS filtering, a firewall and a network traffic monitor and . Apparently its anti-theft and firewall’s most advanced features require your device to be rooted. The App is compatible with all Android mobile phones and Tablet.


Tushar
                                                           


360 Security- Antivirus App

It has a great design with sleek, simple user friendly interface. What makes this app stand out is its capability to automatically patch your device’s firmware vulnerabilities when it detects them. Its downside is that it does not have anti-theft feature even though this is a common feature in most apps. The app can be downloaded from Google play store.

                                                            
                                               Download 360 Security Antivirus App

Dr.Web v.7 Antivirus Light

It is very efficient in detecting malware, it scored above 90% in the AV-Test procedure. Dr. Web scans data as you try to save it in your device to ensure maximum security. Its user interface however does a very poor job in matching its malware detecting process.






Warning :-The Content Provided here in are for the  Educational Purpose only and not to advertise any kind of products.The Given list of the antivirus are as per the author point of view, it may differ from person to person.  
                     The Author is not responsible for any kind of damage to the devices by the use of these software/apps.So the user must use these product on there own risk only after reading a full features details from the Google play Store.    
Read More

How to charge your iPhone 6 at faster rate

Posted by Utkarsh Jain


In their recent research, the folks at iLounge clarify the fact that the iPhone 6 can draw in 2.1A of current without any hindrance. It means iPhone 6 as well as iPhone 6 plus can reach to 90% of its battery in less than 2 hours. However, the charger in the box of iPhone 6/6Plus having a capacity of 1A along with the Power of 5W, restrict its users to use this feature. So to experience this, users of iPhone can either use the high capacity charger of iPad with a capacity of 2.1Amps and Power of 10W or can purchase a high capacity multi USB charger that can charge the devices at their maximum charging potential.
The USB Charger of iPad only contains 1 Port, but if you choose high capacity multiple UBS charger like the one from CHOETECH, you can charge up to 6 iOS as well as Android devices including iPhone 6, iPhone 6 Plus, iPad Air 2, Galaxy Note 4, Nexus 6 simultaneously in within 2 hours with its smart auto- detection function. The charger has a capacity of 10Amps or each port can deliver 2.4Amps.


charging Iphone 6 faste





A Multi USB Charger charging an iPhone 6 at faster rate (Front View)


How to charge your iPhone 6 at faster rate


A Multi USB Charger Charging an iPhone 6 at faster rate (Rear View of iPhone 6) 
The biggest misconception in the world of Smartphones is that if we use the same charger that is provided by the company in the box, we will get great results. But if consider about the latest iPhone 6 or 6Plus, Apple Inc put the 5W 1A charger in order to reduce the overall cost of product and increase the profit margin from the sales. As a result, users of these latest Smartphones will never experience the fastest charging if they use low capacity based USB charger.
To overcome this issue, an iPhone 6 owner can use a multiport USB charger with high capacity or matching amperage so that they can’t just hanging around at charging station for several hours in order to wait for the battery to get refueled. Go ahead and buy one for your device. This is something you don’t really need to worry about.
(Please insert two back links in the following highlighted keywords in the content: multi USB charger, multi port USB charger)
You can use any of the three images or all together, according to your respective blog. These images are taken by us.


How to charge your iPhone 6 at faster rate




CHOETECH Multi USB Charger Charging iPhone 6, iPad Air 2, Nexus 7, Nexus 5, iPhone 4S simultaneously at faster rate  


Author Bio:

Anthony Johnson is a technical product reviewer, editor and freelance writer. Growing up to express every experience of his life in words, Johnson knew at his young age that he wanted to be a technical writer. He reviewed the first product at the age of 19 and hasn’t looked back. Till date he has reviewed several products from most of the major brands worldwide. In this post he is expressing his views on the use of high capacity based Multiple USB Charger to charge iPhone 6 at faster rate.  

Publisher's Last Words:

This is guest post by Anthony Johnson , Thanks to Anthony Johnson  for this awesome and useful information.if you want to post your article on http://www.allaboutcomputing.net you can contact us at link:- contact us. For more about Computer programming and computer technology or web designing stay connected with http://www.allaboutcomputing.net .
I hope you have got answers of some Questions by this small post and I know you have lot of questions, So please feel free to ask in comment section or you can mail me my    e mail id is : tushar.bedekar11@gmail.com 
Read More

Windows 10:Multiple Devices One Operating System

Posted by Tushar Bedekar


Say Hi,ti the new upcoming member of the Microsoft family.An its not Windows 9 But Microsoft has decided to skip a version of windows.And thus Launching the new vibrant,dynamic version of windows 10!

 Microsoft Hope to win back the many desktop PC users that windows 8 and windows 8.1 series alienated in great numbers back when it was released in late 2012.

Microsoft announce that its next OS would get a bunch of the new and returning features, including a start menu and also with a version of cortana  voice  assistant that we have in the Microsoft windows phone platform , an action center(notification center),the flexibility to run multiple apps on one screen simultaneously an much more.

 windows 10! preview version is available on the official windows website in both the 32 and 64 bit versions.


 Some features of windows 10! are listed bellow:-


  • The Start Menu returns.
The familiar Start menu is back, but it brings with it a new customization space for your favorite apps and Live Tiles.
  • Virtual Desktops.
  • Metro Apps On the Desktop.
  • Desktop interface overhaul.
  • A new Task View Button.
  • Improved snapping.
  • Find Files Faster.
 File Explorer now displays your recent files and frequently visited folders making for finding files you've worked on is easier.
  • Multiple Desktop.
The familiar Start menu is back, but it brings with it a new customization space for your favorite apps and Live Tiles.

Screen Shots:-





Warning 

  • The Content Provided here in is only for the educational purpose and not to harm any one. 
Read More

INTERVIEW QUESTIONS IN "C PROGRAMMING "LANGUAGE

Posted by Tushar Bedekar 2 Comments


TABLE OF CONTENTS

CHAPTER 1: Variables & Control Flow

1. What is the difference between declaring a variable and defining a variable? 
2. What is a static variable? 
3. What is a register variable? 
4. Where is an auto variable stored? 
5. What is scope & storage allocation of extern and global variables? 
6. What is scope & storage allocation of register, static and local variables?
7. What are storage memory, default value, scope and life of Automatic and Register storage class? 
8. What are storage memory, default value, scope and life of Static and External storage class? 
9. What is the difference between 'break' and 'continue' statements?
10. What is the difference between 'for' and 'while' loops?

solution:-Download link


CHAPTER 2: Operators, Constants & Structures


1. Which bitwise operator is suitable for checking whether a particular bit is ON or OFF? 
2. Which bitwise operator is suitable for turning OFF a particular bit in a number? 
3. What is equivalent of multiplying an unsigned int by 2: left shift of number by 1 or right shift of number by
1? 
4. What is an Enumeration Constant?
5. What is a structure? 
6. What are the differences between a structure and a union? 
7. What are the advantages of unions? 
8. How can typedef be to define a type of structure? 
9. Write a program that returns 3 numbers from a function using a structure. 
10. In code snippet below: 
struct Date {
 int yr;
 int day;
 int month;
} date1,date2;
date1.yr = 2004;
date1.day = 4;
date1.month = 12;
Write a function that assigns values to date2. Arguments to the function must be pointers to the
structure, Date and integer variables date, month, year. 

solution:-Download link

CHAPTER 3: Functions


1. What is the purpose of main() function? 
2. Explain command line arguments of main function? 
3. What are header files? Are functions declared or defined in header files ? 
4. What are the differences between formal arguments and actual arguments of a function? 
5. What is pass by value in functions? 
6. What is pass by reference in functions? 
7. What are the differences between getchar() and scanf() functions for reading strings? 
8. Out of the functions fgets() and gets(), which one is safer to use and why? 
9. What is the difference between the functions strdup() and strcpy()? 

solution:-coming-soon


CHAPTER 4: Pointers


1. What is a pointer in C? 
2. What are the advantages of using pointers? 
3. What are the differences between malloc() and calloc()? 
4. How to use realloc() to dynamically increase size of an already allocated array? 
5. What is the equivalent pointer expression for referring an element a[i][j][k][l], in a four dimensional array?
6. Declare an array of three function pointers where each function receives two integers and returns float. 
7. Explain the variable assignment in the declaration
int *(*p[10])(char *, char *);
8. What is the value of 
sizeof(a) /sizeof(char *)
in a code snippet:
char *a[4]={"sridhar","raghava","shashi","srikanth"};
9. (i) What are the differences between the C statements below: 
char *str = "Hello";
char arr[] = "Hello";
(ii) Whether following statements get complied or not? Explain each statement. 
arr++;
*(arr + 1) = 's';
printf("%s",arr);

solution:-coming-soon


CHAPTER 5: Programs


1. Write a program to find factorial of the given number. 
2. Write a program to check whether the given number is even or odd. 
3. Write a program to swap two numbers using a temporary variable. 
4. Write a program to swap two numbers without using a temporary variable. 
5. Write a program to swap two numbers using bitwise operators. 
6. Write a program to find the greatest of three numbers. 
7. Write a program to find the greatest among ten numbers. 
8. Write a program to check whether the given number is a prime. 
9. Write a program to check whether the given number is a palindromic number. 
10.Write a program to check whether the given string is a palindrome. 
11.Write a program to generate the Fibonacci series. 
12.Write a program to print "Hello World" without using semicolon anywhere in the code. 
13.Write a program to print a semicolon without using a semicolon anywhere in the code. 
14.Write a program to compare two strings without using strcmp() function. 
15.Write a program to concatenate two strings without using strcat() function. 
16.Write a program to delete a specified line from a text file. 
17.Write a program to replace a specified line in a text file. 
18.Write a program to find the number of lines in a text file. 
19.Write a C program which asks the user for a number between 1 to 9 and shows the number. If the user inputs a number out of the specified range, the program should show an error and prompt the user for a valid input. 
20.Write a program to display the multiplication table of a given number.

solution:-coming-soon
Read More

Try If You Can

Posted by Tushar Bedekar




  • Note:- You Can Also Mail Your Responses at Contact us
  • The responses May be Generated either using GCC or Turbo C compiler.It does`t matter but the correctness of responses is required.
  • Download Turbo C HERE
  • Online Compiler HERE

Read More

C Program to Print 1-10 numbers without using Conditional Loops

Posted by Tushar Bedekar
Print 1-10 numbers without using Conditional Loop i.e without using
  • for Loop
  • while Loop
  • do-while Loop


#include<stdio.h>

void printNumber(int value) {
   int i;
   printf("%d\n", value);          //The Following programme is written using the concept of recursion
   i = value + 1;

   if (i > 10)
      return;
   printNumber(i);
}

void main() {
   printNumber(1);
}
Read More

Algorithms and Flowchart in C Programming

Posted by Tushar Bedekar
                              

                                           Algorithms:-
A sequential solution of any program that written in human language,called algorithm.
Algorithm is first step of the solution process, after the analysis of problem, programmer write the algorithm of that problem.
Example of Algorithms:
Q. Write a algorithms to find out number is odd or even?
Ans. 
step 1 : start
step 2 : input number
step 3 : rem=number mod 2
step 4 : if rem=0 then
               print "number even"
           else
               print "number odd"
           end if
step 5 : stop



                                            Flowchart:-

1. Graphical representation of any program is called flowchart.

2. There are some standard graphics that are used in flowchart as following:








Q. Make a flowchart to input temperature, if temperature is less than 32 then print "below freezing" otherwise print  "above freezing"?
Ans.










Read More

How To Increase Internet Speed without the use of any software

Posted by Tushar Bedekar

Many times we find that our internet speed is slow and we get tired to use it for a long time. Now here is the solution. Actually.Actually what our PC or Our Laptop reserves some amount of the internet bandwidth(nearly 20% default). And now if we make this reserved band width to a zero than the internet speed can be increased by the certain amount.So in order to increase your internet speed just follow the steps given below:-

Steps:-


  • First of all open run just by pressing the keyboard shortcut(windows key +R)
  • Then enter the command given below:-                                              gpedit.msc
  • Now a windows opens having the name (local group policy editor)
  • In the left most corner it has been written (administrative temp lets)
  • Inside that administrative temp-lets click on the network.
  • Now in the right hand side window you will find QoS packet scheduler.
  • Now double click on that.
  • After Double clicking it you will find the option limit reversible bandwidth.
  • Again Double click on that.
  • you will find the option bandwidth limit (%) in which 20 or any other value is being written.
  • Make it zero and than click apply.
  • Now you have done.
  • Then restart your Browser you will find some speed has been increased.  

Screen Shots:-


http://www.allaboutcomputing.net/
 http://www.allaboutcomputing.net/

http://www.allaboutcomputing.net/
http://www.allaboutcomputing.net/

Warning:-

  • We are not responsible for any damages that may happened by using this Techniques. 
  • Use this guide at your own risk. We shall not have any liability or responsibility for whatever happens to you and your device by using the instructions in this guide.
  • The instructions provided in this tutorial for educational purpose only. There is no guarantee that these steps will work for your device.
  •  Applying this guide to any other device or any other model may produce many problems.
  • Read and Understand the whole tutorial first, before going to perform the steps.
  • At the same time this content is not to harm any one but it is only for educational purpose.


Read More
back to top