BLOG

 what is c language?

Ans.
The C programming language is a computer programming language  developed to do system programming for the operating system UNIX .
 People can write their programs as a series of step-by-step instructions makes C a procedural language and it is an imperative language too.
The main features of C language include low-level access to memory, a simple set of keywords, and clean style, these features  make C language suitable for system programmings like an operating system or compiler development. Many later languages have borrowed syntax/features  directly or indirectly from C language. Important of C and its applications :- C is highly portable and is used for scripting system applications which form a major part of Windows, UNIX, and Linux operating system. C is a general-purpose programming language and can efficiently work on enterprise applications, games, graphics, and applications requiring calculations, etc.

Program print table using recursion function in c/c++.

#include<stdio.h>
#include<conio.h>
void fact(int n,int m);
void main()
{
int n,f;
clrscr();
printf("enter any number");
scanf("%d",&n);
fact(n,1);
getch();
}
void fact(int n,int m)
{
printf("\n%d",n*m);
if(m==10)
return;
m++;
fact(n,m);
}


Print a to z using recursive function c 

#include<stdio.h>
#include<conio.h>
void abc(char);
void main ()
{
        clrscr();
        abc('a');
        getch();
}
void abc (char a)
{
        printf("\t%c",a);
        if (a=='z')
        return;
        a++;
        abc(a);
}

Print z to a using recursive function c

#include<stdio.h>
#include<conio.h>
void abc (char);
void main()
{
        clrscr();
        abc('z');
        getch();
}
void abc (char a)
{
        printf("\t%c",a);
        if(a=='a')
        return;
        a--;
        abc(a);
}

This is Quiz Game Project in c/c++ , this is developed by Tech JCC Mahilpur

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int i,j,k=0,cs1=0,sc=0,cs2=0,cs3=0;
clrscr();
char c;
printf("\n\n*********WELCOME TO THIS QUIZ GAME********");
do
{
printf("\n1.SPORTS");
printf("\n2.POLITICS");
printf("\n3.GENERAL KNOWLEDGE");
printf("\n4.EXIT\n");
scanf("%d",&i);
switch(i)
{
case 1:
cs1++;
if(cs1==1)
{
sc+=10;
printf("\n(a)which is the national game of india?");
printf("\noptions\n1.cricket\n2.football\n3.hockey");
scanf("%d",&j);
if(j==3)
{
printf("\ncorrect");
k+=10;
}
else
printf("\nwrong");
}
if(cs1==2)
{
sc+=10;
printf("\n(b)who is the captain of indian football team?");
printf("\n1.sunil shetri\n2.ronaldo\n3.messi");
scanf("%d",&j);
if(j==1)
{
printf("\ncorrect");
k+=10;
}
else
printf("\nwrong");
}
if(cs1==3)
{
cs1=1;
sc+=10;
printf("\n(c)who is the captain of indian cricket team?");
printf("\n1.M.S.Dhoni\n2.V.kohli\nYuvraj Singh");
scanf("%d",&j);
if(j==2)
{
printf("\ncorrect");
k+=10;
}
else
printf("\nwrong");

}
break;
case 2:
cs2++;
if(cs2==1)
{
sc+=10;
printf("\n(a)who was the 1st president of India?");
printf("\noptions\n1.Rajindera Prasad\n2.D.r Radha Krishnan\n3.Zakir Husain");
scanf("%d",&j);
if(j==1)
{
printf("\ncorrect");
k+=10;
}
else
printf("\nwrong");
}
if(cs2==2)
{
sc+=10;
printf("\n(b)who is the president of America?");
printf("\n1.Barack obama\n2.donald trump\n3george w.bush");
scanf("%d",&j);
if(j==2)
{
printf("\ncorrect");
k+=10;
}
else
printf("\nwrong");
}
if(cs2==3)
{
cs3=1;
sc+=10;
printf("\n(c)who was the 1st president of USA?");
printf("\n1.George Washington\n2.John Adams\n3.Thomas Jefferson");
scanf("%d",&j);
if(j==1)
{
printf("\ncorrect");
k+=10;
}
else
printf("\nwrong");
 }
 break;
case 3:
cs3++;
if(cs3==1)
{
sc+=10;
printf("\n(a)who was the most wanted terrorist in world?");
printf("\n1.osama bin laden\n2.bagdadi\n3.mohammad atif");
scanf("%d",&j);
if(j==2)
{
printf("\ncorrect");
k+=10;
}
else
printf("\nwrong");
}
if(cs3==2)
{
sc+=10;
printf("\n(b)which is the national animal of india?");
printf("\n1.Lion\n2.Dog\n3.Cow");
scanf(" d",&j);
if(j==1)
{
printf("\ncorrect");
k+=10;
}
else
printf("\nwrong");
}
if(cs3==3)
{
cs3=1;
sc+=10;
printf("\n(c)which is the national flower of india?");
printf("\n1.marigold\n2.rose\n3.lotus");
scanf("%d",&j);
if(j==3)
{
printf("\ncorrect");
k+=10;
}
else
printf("\nwrong");
}
break;
case 4:
break;
}
if(sc!=0)
printf("\ndo u want to play the game again.press y/n\n");
else
exit(0);
fflush(stdin);
scanf("%c",&c);
}
while(c=='y'|c=='Y');
printf("\n your score is %d out of %d",k,sc);
getch();
}



NESTED SWITCH :


#include<stdio.h>
#include<conio.h>
void main()
{
char c;
int i;
clrscr();
printf("enter any char");
fflush(stdin);
scanf("%c",&c);
switch(c)
{
case 'a':
printf("enter any num");
scanf("%d",&i);
switch(i)
{
case 1:
printf("one");
break;
case 2:
printf("two");
break;
default:
printf("wrong");
break;
}
break;
case 'b':
printf("enter any num");
scanf("%d",&i);
switch(i)
{
case 3:
printf("three");
break;
case 4:
printf("four");
break;
default:
printf("wrong");
break;
}
break;
default:
printf("wrong char enter");
break;
}
getch();
}



OUTPUT  :-  enter any char a
enter any num 1
  one


enter any char b
enter any num 6
wrong


enter any char d
wrong char enter

10 comments:

  1. Thank you for this article because it’s really informative, I love reading your article and I hope that I will read some more about this stuff, it’s really informative and very entertaining. Thanks a lot, and have a great day.

    JAVA Training Course in Delhi with Updated Content
    SAP/ERP Training Course with 20% Off
    Complete MIS Training Course with 15% Off
    Complete SAS Training Course with 25% Off

    ReplyDelete
  2. I always look forward read blogs about python & I want to learn python. Keep sharing this kind of content and write more about python because Python training
    is one of the best ways to get leads in the current time.

    ReplyDelete
  3. Usually, I never comment on blogs but your article about The Psychology Of High Performance is so convincing that I never stop myself to say something about it. You’re doing a great job Man, Keep it up.

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. I am very thankful to you that you have shared this information with us. I got some different kinds of knowledge from your web page, and it is really helpful for everyone. Thanks for sharing it. Read more info about learning academy pte

    ReplyDelete
  6. These tips may help me in the future. Thank you for sharing visit also High Impact Factor Journals In Computer Science .

    ReplyDelete
  7. I am very thankful to you that you have shared this information with us. I got some different kinds of knowledge from your web page, and it is really helpful for everyone. Thanks for sharing it. Read more info about Business Analyst Course Online USA

    ReplyDelete
  8. Thank you for sharing an amazing & wonderful blog. This content is very useful, informative and valuable in order to enhance knowledge. Keep sharing this type of content with us & keep updating us with new blogs. Apart from this, if anyone who wants to join C, C++ & AutoCAD Training institute in Delhi, can contact 9311002620 or visit our website-
    https://htsindia.com/autocad-training-institute

    ReplyDelete
  9. its very use full and knowlegebel website .. its teaching method very simple.

    ReplyDelete