100+ C++ Programs with Output: For Students & Professionals by Pataskar Aniket

100+ C++ Programs with Output: For Students & Professionals by Pataskar Aniket

Author:Pataskar, Aniket [Pataskar, Aniket]
Language: eng
Format: azw3
Published: 2016-01-29T05:00:00+00:00


This program takes in two integers x and y as a screen input from the user.

The sum and average of these two integers are calculated and outputted using the 'cout' command.

INPUT :

8 6

OUTPUT :

The sum of 8 and 6 is 14.

The average of 8 and 6 is 7.

49. Program to enter velocity, acceleration and time and print final velocity using the formula : v = u + a * t

#include <iostream.h>

#include <conio.h>

void main()

{

clrscr();

int v,u,a,t;

cout << "Enter the velocity, acceleration, time as integers : " << endl;

cin>>u>>a>>t;

v=u+a*t;

cout << "The final velocity is " << v << "." << endl;

getch();

}

This program takes in the velocity, acceleration and the time as a screen input from the user.

The final velocity is calculated using the formula v = u + a * t, and then outputted using the 'cout' command.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.