C Tutorials

C Project – Tic Tac Toe Game 0

C Project – Tic Tac Toe Game

Program 1 #include <stdio.h> #include<conio.h> char board[3][3] = { {‘ ‘, ‘ ‘, ‘ ‘}, {‘ ‘, ‘ ‘, ‘ ‘}, {‘ ‘, ‘ ‘, ‘ ‘} }; void printBoard() { printf(“————-\n”); for (int...

C Project – Tic Tac Toe Game 0

C Project – Tic Tac Toe Game

Program 1 #include <stdio.h> #include<conio.h> // 2 D Array char board[3][3] = { {‘ ‘, ‘ ‘, ‘ ‘}, {‘ ‘, ‘ ‘, ‘ ‘}, {‘ ‘, ‘ ‘, ‘ ‘} }; void printBoard()...

C Practical – Simple Calculator and Temperature Converter 0

C Practical – Simple Calculator and Temperature Converter

Program 1 // Simple calculator #include<stdio.h> #include<conio.h> #define clrscr() system(“cls”) int main() { char operator1; double num1,num2,num3; clrscr(); printf(“Enter First Number: “); scanf(“%lf”,&num1); printf(“Enter Second Number: “); scanf(“%lf”,&num1); printf(“Enter Operator (+ , – ,...

C Project – Rock Paper Scissor 0

C Project – Rock Paper Scissor

Program 1 // Rock , Paper , Scissors Game #include<stdio.h> #include<conio.h> #include<time.h> #define clrscr() system(“cls”) int main() { clrscr(); int userchoice,compchoice; srand(time(0)); compchoice=rand()%3+1; printf(“\n ————Rock , Paper , Scissors Game———–“); printf(“\n 1 . Rock”);...

C Project – Number Guessing Game 0

C Project – Number Guessing Game

Program 1 // Project for Guess randmom number #include<stdio.h> #include<conio.h> #include<time.h> #define clrscr() system(“cls”) int main() { clrscr(); int me,you,i=1,count=10; srand(time(NULL)); me=rand()%100; while(i<=10) { printf(“\n Enter a number : %d chance left”,count); scanf(“%d”,&you); if(me==you)...

C Project – Coin Toss Game 0

C Project – Coin Toss Game

Program 1 #include<stdio.h> #include<conio.h> #include<time.h> #define clrscr() system(“cls”) int main() { clrscr(); int userchoice,coinchoice; srand(time(0)); printf(“\n Welcome in the coin toss Game ! \n”); printf(“\n————————————-“); printf(“\nChoose 1. Head \nChoose 2. Tail \n “); printf(“\n————————————–“);...

C Project – How to Generate Random Number 0

C Project – How to Generate Random Number

Program 1 #include<stdio.h> #include<conio.h> #include<time.h> #define clrscr() system(“cls”) int main() { clrscr(); int n,l,u; // srand(time(NULL)); printf(“Enter value of Lower Bound: “); scanf(“%d”,&l); printf(“Enter value of Upper Bound: “); scanf(“%d”,&u); n=(rand()%(u+l+1))+l; printf(“%5d”,n); // int...

Fibonacci Series Using Recursion in C 0

Fibonacci Series Using Recursion in C

Program 1 // Fibbonacci Series using recursion // 0 1 1 2 3 5 8 13 24 ….. n #include<stdio.h> #include<conio.h> void fibbonacci(int); int main() { system(“cls”); int n; printf(“Enter a number”); scanf(“%d”,&n); fibbonacci(n);...

C Command Line Arguments 0

C Command Line Arguments

Program 1 #include<stdio.h> #include<conio.h> #include<string.h> int main(int argc,char *argv[]) { // printf(“\nTotal Arguements: %d”,argc); // printf(“\n1 Arguement: %s”,argv[0]); // printf(“\n2 Arguement: %s”,argv[1]); // printf(“\n3 Arguement: %s”,argv[2]); system(“cls”); if(argc!=2) printf(“Required 2 Argument only: “) ;...