Showing posts with label C programming. Show all posts
Showing posts with label C programming. Show all posts

Monday, July 14, 2014

Five Graphics statement's syntax of C are given bellow - 

a.       line() function: This function uses to draw Lines in C programming.
Syntax –
Void far line(int startx, int starty, int endx, int endy);
b.      circle() function: This function uses to draw Circles in C programming.
Syntax –
Void far circle(int x, int y, int radius);
c.       drawpoly() function: This function uses to draw Polygon in C programming.
Syntax –
Void far drawpoly(int numpoints, int far*points);
d.      lineto() function: This function uses to draw Line from present place to (x,y).
Syntax –
Void far lineto(int x, int y);
e.      setlinestype() function: This function uses to draw lines of various styles.
Syntax –

Void far setlinetype(int style, unsigned pattern, int width);

Sunday, July 13, 2014

C is a general purpose programming language. It’s called as structured language also. Here are some short questions and their answers on C programming are given bellow.

Question No. – 1: Who invented the Programming in C?
Ans: Dennis Ritchie of AT & T Bell Laboratory.
Question No. – 2: When he invented Programming in C?
Ans: In the year 1972
Question No. – 3: Write down some Library Function’s name of C.
Ans: getchar(), scanf(), gets(), fscanf(), printf()
Question No. – 4: Write down some C complier’s name.
Ans: Turbo C, Borland C, Microsoft C, Power C, Watcom C
Question No. – 5: How many kinds of Programming Language?
Ans: Generally programming language is of two kinds.
a.       High Level Language
b.      Low Level Language
Low Level Language has two kinds more
a.       Machine Language
b.      Assembly Language
Question No. – 6: What is the basic format of a C program?
Ans:     >> Include Files
            >> Main Function
            >> Other Function (Library/User defined functions)
Question No. – 7: How many kinds of data type?
Ans: There are 4 kinds of data type in C.
1.      Character Type Data
2.      Integer Type Data
3.      Floating Point Data
4.      Double Type Data
Question No. – 8: What is the memory space for Character Type Data?
Ans: 1 byte
Question No. – 9: What is the memory space for Integer Type Data?
Ans: 2 bytes
Question No. – 10: What are the memory spaces for Float Point and Double Type Data?


Ans: 4 bytes (float) and 8 bytes (double).

Friday, May 2, 2014

Show 5 stars (*****) using C program

Hey. Today I’m going to tell you about something you don’t know. Do you know how to show output 5 stars (*****) using C program? If you don’t know, this post is for you.

Here is the code given bellow. Now copy it and use on your C compiler.

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i;
for(i=0;i<=5;i++)
printf("*");
getch();
}


If you like this post, Please share it to your friends so they know about it. Keep visiting to get all updates. Thank you.  

Swapping values using C program

Hello everybody. I'm back after a long time. I was busy with my works and studies. Today I came with some code of C program.

Now I'm going to give you the code of Swapping in C program. The code is given bellow.

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,t;
clrscr();
printf("Enter the value of a:");
scanf("%d",&a);
printf("Enter the value of b:");
scanf("%d",&b);
t=a;
a=b;
b=t;
printf("After swapping\n a= %d b= %d",a,b);
getch();
}


Practice yourself. You should know that, Practice makes a man perfect. Thank you all. 

Wednesday, March 26, 2014

Hello everybody. How are you all? Hope fine and fresh by the grace of Almighty. Did you practice “Summation of two numbers in C”? Oh you don’t know about it? I’ve posted it here (http://plans-in-action.blogspot.com/2014/03/summation-of-two-numbers-in-c.html).

Now I’m going to tell you how to print your Name and address using C language. Here you have to use a data type char and variables will be string. Now follow the code given bellow.

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
char *Name, *Address;
printf("Enter your Name:");
gets(Name);
printf("Enter your Address:");
gets(Address);
puts(Name);
puts(Address);
getch();
}

Try yourself and check. If you think this article will be helpful for others, please share it. Thank you very much. 

Tuesday, March 18, 2014

Use copied code on Turbo C

I've posted a code of C programming for beginners. Did you practice that? Did you get success to use copied code directly on your compiler?
If you use Turbo C compiler you’ll not be able to paste directly on your project editor copied from anywhere. There is a trick for you. I’m now going to tell you the secret.
If you use Turbo C compiler, just copy the code from anywhere. Now create a text file. It’ll appear to you as New Text Document.txt. Now rename it as New Text Document.CPP . Here you've to change the extension. After that, paste your copied code in this file. Now copy the file and go to your drive where you installed the compiler. Search a folder named “BIN”. Open the folder and paste the New Text Document.CPP file.

Completed! Now run your Turbo C compiler. Go to file menu, Click on open, search the file New Text Document.CPP and open it. You’ll get the code you copied from other side. Now compile it, run and enjoy. 

Monday, March 17, 2014

Summation of two numbers in C

Hello everybody. How’s your day? Great I think. Now I’m going to tell you about C programming.
You know, C is a powerful system programming language. Today I’m going to solve a problem in C. It’s a very basic problem I think. The problem is to summation of two numbers.
The code is given below:
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c;
printf("Enter the value of a:");
scanf("%d",&a);
printf("Enter the value of b:");
scanf("%d",&b);
c=a+b;
printf("c=%d",c);
getch();
}

Thanks everybody for joining me. Visit this blog to get regular updates.