SlideShare a Scribd company logo
1 of 7
1.) /* HELLO.C -- Hello, world */
#include <stdio.h>
main()
{
printf("Hello, worldn");
}
2.) #include<stdio.h>
#include<conio.h>
void main()
{
char ch;
clrscr();
Printf("press any key n");
Scanf("%c", &ch);
Printf("ASCII value is %d", ch);
getch();
}
3.)
#include<stdio.h>
#include<conio.h>
void main()
{
char ch;
clrscr();
printf("press any key n");
scanf("%c",&ch);
printf("ASCII value is %d",ch);
getch();
}
4.)
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c,max;
clrscr();
printf("enter three values",3);
scanf("%d %d %d",&a,&b,&c);
max=(a>b)?(a>c)?(a:c):(b>c)?(b:c);
printf("largest no is %dn",max);
getch();
}
5.)
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,max;
clrscr();
a=8;
b=5;
max=(a>b?a:b);
printf("%d n",a);
printf("%d n",b);
printf("Largest no=%d n",max);
getch();
}
6.)
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c,max;
clrscr();
printf("enter three values",3);
scanf("%d %d %d",&a,&b,&c);
max=(a>b)?(a>c)?(a:c):(b>c)?(b:c);
printf("largest no is %dn",max);
getch();
}
7.)
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
float r,v;
clrscr();
prinftf("enter radiusn");
scanf("%f",&r);
v=4.0/3* 3.14159*pow(r,3);
printf("volume=%fn",v);
getch();
}
8.)
#include<stdio.h>
#include<conio.h>
void main()
{
char ch;
clrscr();
printf("ASCII values are %d",ch);
printf("print value a");
getch();
}
9.)
#include<stdio.h>
#include<conio.h>
main()
{
int num;
clrscr();
printf("enter any number");
scanf("%d",&num);
if(num>=0)
printf("positive");
else
printf("negative");
getch();
}
10.) #include<stdio.h>
#include<conio.h>
main()
{
clrscr();
printf("hyd");
clrscr();
printf("sec");
clrscr();
printf("BDN");
}
11.)
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
float r,v;
clrscr();
prinftf("enter radiusn");
scanf("%f",&r);
v=4.0/3* 3.14159*pow(r,3);
printf("volume=%fn",v);
getch();
}
12.)
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d,e,f;
clrscr();
a=2;
b=5;
c=a+b;
d=a-b;
e=a/b;
f=a*5;
printf("%d n",c);
printf("%d n", d);
printf("%d n",e);
printf("%d n",f);
getch();
}

More Related Content

What's hot

Novatadas en java
Novatadas en javaNovatadas en java
Novatadas en java
wmca28
 
Infitopost notepad
Infitopost   notepadInfitopost   notepad
Infitopost notepad
Anand Kumar
 
Simular un next del recordset en php de forma rudimentaria
Simular un next del recordset en php de forma rudimentariaSimular un next del recordset en php de forma rudimentaria
Simular un next del recordset en php de forma rudimentaria
jbersosa
 

What's hot (20)

Heep implementation in c
Heep implementation in cHeep implementation in c
Heep implementation in c
 
Vcs6
Vcs6Vcs6
Vcs6
 
Novatadas en java
Novatadas en javaNovatadas en java
Novatadas en java
 
Lector
LectorLector
Lector
 
bai tap-loi-giai-ngon-ngu-lap-trinh-c
 bai tap-loi-giai-ngon-ngu-lap-trinh-c bai tap-loi-giai-ngon-ngu-lap-trinh-c
bai tap-loi-giai-ngon-ngu-lap-trinh-c
 
Fcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt ChartFcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt Chart
 
Structure of c program | CS8251 | Programming in c | Learn Hub
Structure of c program | CS8251 | Programming in c | Learn HubStructure of c program | CS8251 | Programming in c | Learn Hub
Structure of c program | CS8251 | Programming in c | Learn Hub
 
12 2 문자열 응용
12 2 문자열 응용12 2 문자열 응용
12 2 문자열 응용
 
Infitopost notepad
Infitopost   notepadInfitopost   notepad
Infitopost notepad
 
Como crear una matriz de 3x3 con c++ con menu
Como crear una matriz de 3x3 con c++ con menu Como crear una matriz de 3x3 con c++ con menu
Como crear una matriz de 3x3 con c++ con menu
 
Ooprc3b
Ooprc3bOoprc3b
Ooprc3b
 
Simular un next del recordset en php de forma rudimentaria
Simular un next del recordset en php de forma rudimentariaSimular un next del recordset en php de forma rudimentaria
Simular un next del recordset en php de forma rudimentaria
 
Menu orastat.c
Menu orastat.cMenu orastat.c
Menu orastat.c
 
08 1 함수란
08 1 함수란08 1 함수란
08 1 함수란
 
200+ C-Programs
200+ C-Programs200+ C-Programs
200+ C-Programs
 
Algunas razones por las que CSS3 lo peta
Algunas razones por las que CSS3 lo petaAlgunas razones por las que CSS3 lo peta
Algunas razones por las que CSS3 lo peta
 
Aman
AmanAman
Aman
 
Sum2
Sum2Sum2
Sum2
 
MFC Click
MFC ClickMFC Click
MFC Click
 
Dsa 1
Dsa 1Dsa 1
Dsa 1
 

Viewers also liked

Minimal standard c program
Minimal standard c programMinimal standard c program
Minimal standard c program
Swain Loda
 
Frequently asked questions in c
Frequently asked questions in cFrequently asked questions in c
Frequently asked questions in c
David Livingston J
 
C program to turn off your pc
C program to turn off your pcC program to turn off your pc
C program to turn off your pc
Saurabh Khetan
 
C language questions_answers_explanation
C language questions_answers_explanationC language questions_answers_explanation
C language questions_answers_explanation
srinath v
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
Mainak Sasmal
 
C programs
C programsC programs
C programs
Minu S
 

Viewers also liked (20)

Minimal standard c program
Minimal standard c programMinimal standard c program
Minimal standard c program
 
Frequently asked questions in c
Frequently asked questions in cFrequently asked questions in c
Frequently asked questions in c
 
C Programming :- An Example
C Programming :- An Example C Programming :- An Example
C Programming :- An Example
 
C from hello world to 010101
C from hello world to 010101C from hello world to 010101
C from hello world to 010101
 
C program to turn off your pc
C program to turn off your pcC program to turn off your pc
C program to turn off your pc
 
C program language tutorial pattern printing
C program language tutorial pattern printingC program language tutorial pattern printing
C program language tutorial pattern printing
 
C Programming Example
C Programming ExampleC Programming Example
C Programming Example
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
 
C language questions_answers_explanation
C language questions_answers_explanationC language questions_answers_explanation
C language questions_answers_explanation
 
Understand more about C
Understand more about CUnderstand more about C
Understand more about C
 
Core programming in c
Core programming in cCore programming in c
Core programming in c
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 
C program language tutorial for loop while loop do while loop
C program language tutorial for loop while loop do while loopC program language tutorial for loop while loop do while loop
C program language tutorial for loop while loop do while loop
 
A c program of Phonebook application
A c program of Phonebook applicationA c program of Phonebook application
A c program of Phonebook application
 
C programs
C programsC programs
C programs
 
C lab-programs
C lab-programsC lab-programs
C lab-programs
 
C Programming
C ProgrammingC Programming
C Programming
 
Important C program of Balagurusamy Book
Important C program of Balagurusamy BookImportant C program of Balagurusamy Book
Important C program of Balagurusamy Book
 
OpenGurukul : Language : C Programming
OpenGurukul : Language : C ProgrammingOpenGurukul : Language : C Programming
OpenGurukul : Language : C Programming
 
Computer Graphics Lab File C Programs
Computer Graphics Lab File C ProgramsComputer Graphics Lab File C Programs
Computer Graphics Lab File C Programs
 

C language program