Posts

Showing posts from August, 2020

Flowchart and C program to find the factorial of a given number.

Image
Flowchart : Program : #include<stdio.h> #include<conio.h> void main() { int f,a,p=1; clrscr(); printf("Enter any number :\t"); scanf("%d",&f); for(a=f;a>0;a--) p=p*a; printf("Factorial of a given number = %d",p); getch(); } Output :

C program to calculate the Simple interest and Compound interest when Principal, Rate & Time are given.

Image
Program   :  #include<stdio.h>                  // here p=pricipal value,r=rate,t=time #include<conio.h>                 // si=simple interest, ci=compound interest #include<math.h> void main() { float p,r,t,si,ci; clrscr(); printf("Enter the values of Principal :\n"); scanf("%f",&p); printf("Enter the value of Rate :\n"); scanf("%f",&r); printf("Enter the value of Time :\n"); scanf("%f",&t); si=(p*r*t)/100; ci=p*(pow((1+r/100),t)); printf("S.I is :%f\n",si); printf("C.I is :%f",ci); getch(); } output :

C program that converts given temperature from Fahrenheit to Celcius.

Image
#include<stdio.h> #include<conio.h> void main() { float c,f; clrscr(); printf("Enter the temperature value of Fahrenheit :\n"); scanf("%f",&f); c=5*(f-32)/9; printf("Temperature in celcius is:\n%f",c); getch(); } Output 👆

Flowchart & C program to find whether agivern year is a Leap yr or NOT ?

Image
  Flowchart  :- Program  :- #include<stdio.h> #include<conio.h>                                    void main() { int year; clrscr(); printf("Enter any year : "); scanf("%d",&year); if(year%100==0) { if(year%400==0) printf("%d is a Leap Year.",year); else printf("%d is Not a leap year.",year); } else { if(year%4==0) printf("%d is a Leap year.",year); else printf("%d is Not a leap year.",year); } getch(); }

Algorithm, Flowchart ad c Program to write a Table of a number.

Image
  Algorithm  :- step 1 :  Read a number (n) step 2 :  i=1 step 3 :  print n*i step 4 :  i=i+1 step 5 :  if i<11 or i<=10 goto step 3 step 6 :  STOP Flowchart :- Program :- #include<stdio.h>                                         #include<conio.h>                                                                       void main() { int i,n,table=1; clrscr(); printf("Enter any number\n"); scanf("%d",&n); printf("Table of %d is\n",n); for(i=1;i<=10;i++) { table=n*i; printf("%d",table); printf("\n"); } getch(); }

C program to find the Area and Circumference of a Circle.

Image
#include<stdio.h> #include<conio.h> void main() { int radius;                          Output 👆 float area,circumference; clrscr(); printf("Enter the radius of Circle :"); scanf("%d",&radius); area=3.14*radius*radius; circumference=2*3.14*radius; printf("Area of a circle =%f\n",area); printf("Circumference of a circle =%f",circumference); getch(); }

Flowchart & C program for find the sum of first 50 Natural numbers.

Image
Flowchart :- Program  :- #include<stdio.h>                                                                       #include<conio.h> void main() { int number,sum=0; clrscr(); for(number=1; number<=50; number++) { sum=sum+number; } printf("Sum of first 50 Natural numbers = %d\n",sum); getch(); }

Programming in C if 'c' is greater than 25 (c>25) then add two numbers If not then multiply these numbers.

Image
Program :- #include<stdio.h>                #include<conio.h> void main() { int a,b,c,d; clrscr(); printf("Enter the value for a :"); scanf("%d",&a); printf("Enter the value for b :"); scanf("%d",&b); c=a+b; d=a*b; if(c>25) printf("Addition is %d",c); else printf("Multiplication is %d",d); getch(); } Output :- when (c<25) when (c>25)

Flowchart and C Program that prints the greater among 3 numbers.

Image
 Flowchart  :- Program  :- #include<stdio.h> #include<conio.h> void main() { int a,b,c; clrscr(); printf("Enter first number :");                                    Output 👆 scanf("%d",&a); printf("Enter second number :"); scanf("%d",&b); printf("Enter third number :"); scanf("%d",&c); if(a>b) { if(a>c) printf("%d is greatest among these.",a); else printf("%d is greatest among these.",c); } else { if(b>c) printf("%d is greatest among these.",b); else printf("%d is greatest among these.",c); } getch(); }

Flowchart and C Program that prints the greater among tho numbers.

Image
  Flowchart  :- Program  :- #include<conio.h> #include<stdio.h> void main() { int a,b;                                                             Output 👆 clrscr(); printf("Enter first number :"); scanf("%d",&a); printf("Enter second number :"); scanf("%d",&b); if(a>b) printf("The Greater among two numbers is :%d",a); else printf("The Greater among two numbers is :%d",b); getch(); }

C++ program to make Google search page.

Image
Output 👆 #include<iostream.h> #include<conio.h> #include<graphics.h> #include<math.h> void main() {clrscr(); int g=0,d; initgraph(&g,&d,"c:\turboc3\bgi"); setbkcolor(15); setcolor(1); settextstyle(3,0,5); outtextxy(190,140,"G"); setcolor(4); settextstyle(3,0,5); outtextxy(220,140,"O"); setcolor(3); settextstyle(3,0,5); outtextxy(250,140,"O"); setcolor(1); settextstyle(3,0,5); outtextxy(280,140,"G"); setcolor(2); settextstyle(3,0,5); outtextxy(310,140,"L"); setcolor(4); settextstyle(3,0,5); outtextxy(340,140,"E"); setcolor(1); settextstyle(3,0,5); setcolor(4); settextstyle(1,0,2); outtextxy(100,350,"SEARCH"); settextstyle(1,0,2); outtextxy(380,350,"I'M FEELING LUCKY"); setcolor(8); rectangle(140,200,480,230); rectangle(93,350,183,380); rectangle(370,350,580,380); getch(); }

C++ program to make graphical Flower-pot.

Image
#include<stdio.h> #include<dos.h> #include<graphics.h> #include<stdlib.h> #include<math.h>                                                                  Output 👆 #include<conio.h> #define PI 3.14159 #define NUME 30 #define DENOM 100 #define NUMBER 7 #define RAD 2.0 #define DTHETA 0.1 #define REDUX 3 #define SEGS 60 #define MIN 1 void init_graph(); void tdisplay(int, float, int, int, int); void cdisplay(int, int, int); void bucket(); int gd, gm, maxcolor, errorcode; int xo, yo, maxx, maxy, xasp, yasp; double aspectratio; void init_graph() {     detectgraph(&gd, &gm);     initgraph(&gd, &gm, "");     errorcode = graphresult();     if (errorcode != grOk) { printf("graphics system eror : %s", grapherror...

C++ program to make 3-D Animated Moving Car.

Image
 #include<graphics.h> #include<conio.h> #include<dos.h> #include<stdlib.h> #include<process.h>                                      Output 👆   void main() { int gd = DETECT, gm; initgraph(&gd, &gm, "T:bgi"); int t; while (1) { settextstyle(2, 0, 5); outtextxy(100, 10, "Press L-MOVE,H-HOLD,T-BLINK LIGHT"); outtextxy(100, 30, "Press 1 for Quit"); as: setcolor(13); ellipse(380, 127, 20, 152, 130, 35); //////////////////////////////rear//////////////////////////   line(490, 109, 560, 142); line(560, 142, 569, 142); line(569, 142, 582, 102); line(582, 102, 620, 92); line(593, 132, 617, 125);   line(617, 124, 627, 96); line(620, 92, 628, 97);   line(472, 86, 602, 96); line(501, 113, 575, 121); line(443, 77, 475, 80);   line(443, 77, 432, 93); line(475, 80, 472, 85); line(593, 132, 593, 137); line(593, 137, 600, 141); line(600, 141,...