#include <stdio.h>
#include <conio.h>
void main()
{
int p, r, t, si;
clrscr();
printf(" Enter principle, rate of interest & time to find simple interest: ");
scanf(" %d %d %d",& p, & r, & t);
si = ( p * r * t ) / 100;
printf(" Simple interest = %d",si);
getch();
}
OUTPUT:
Enter principle, rate of interest & time to find simple interest: 1000
2
5
Simple interest = 100
Sample C Program To Check Whether A Number Is Prime Or Not.
#include <stdio.h>
#include <conio.h>
void main()
{
int i, n ,r=0;
clrscr();
printf(" Enter any no: ");
scanf("%d",& n);
for( i = 2; i < = n - 1; i++ )
{
if( n % i == 0)
r = 1;
break;
}
if( r == 0)
printf(" Is prime ");
else
printf(" Not prime ");
getch();
}
OUTPUT:
Enter any no: 8
Not prime
ALSO READ:
-- Program To Print First Ten(10) Natural Numbers.
-- Program To Print Fibonacci Series Upto 100.
-- Program To Check Whether A Number Is Prime Or Not.
-- Program To Compute The Reverse Of A Number.
-- Program To Print A Semicolon Without Using A Semicolon.
-- Program To Display Function Without Using The Main Function.
-- Program To Print Any Print Statement Without Using Semicolon.
-- Program To Display Its Own Source Code As Its Output.
-- Program To Swap Two Strings Using strcpy() Function.
-- Program to accept a string and print the reverse of the given string.
-- Program To Get IP Address.
-- Program To Accept An Integer & Reverse It.
-- Program To Convert Given Number Of Days To A Measure Of Time Given In Years, Weeks & Days.
-- Program To Illustrate The Concept Of Unions.
-- Program To Find The Size Of A Union.
... Back To C++ Programs Index
... Back To C++ FAQ's Index
... Back To C Programs Index
... Back To C FAQ's Index
... Back To HR Interview Index
this site is very helpful for me thanks
ReplyDelete