take input name, class, and roll number from user and display Programming

C++ Take Input Name, Class, and Roll Number from User and Display

  • April 21, 2021
  • 0 Comments

Write a program in c++ that can ask for name, class and roll number  and display as Hello Your class is and your roll number is [button color=”red” size=”big” link=”https://namecheap.pxf.io/c/2001466/1291734/5618″ icon=”” target=”true” nofollow=”true”]Don’t miss: .COM for just $0.98![/button] C Code #include<iostream.h>#include<conio.h>void main(){ char name[20]; char clas[6]; int roll; cout<<“nEnter Name:”; cin>>name; cout<<“nEnter Class:”; cin>>clas; cout<<“nEnter […]

read two numbers, check first number divisible by second or not Programming

C – Read Two Numbers, Check First Number Divisible by Second or Not

  • April 21, 2021
  • 0 Comments

Write a c program to read any two numbers, check first number is divisible by second or not. C Code #include<stdio.h>#include<conio.h>void main(){ int first, second; printf(“nEnter two numbers:”); scanf(“%d%d”,&first, &second); if(first%second==0) printf(“nFirst is divisible by second number”); else printf(“nNot divisible”); getch();} Output

Find the Factorial of Entered Number Programming

C Program to Find the Factorial of Entered Number

  • April 20, 2021
  • 0 Comments

Write a c program to take input from user and find the factorial C Code #include <stdio.h>#include <conio.h>#include <math.h>void main(){ int i, number, factorial =1; printf(“Enter number : “); scanf(“%d”,&number); if(number<0) printf(“error:negative number”); else if(number==0) printf(“factorial of 0 i 1”); else{ for (i=1; i<=number; i++) factorial*=i; printf(“factorial is of %d is %d”,number, factorial); } getch();} […]

Read radius of the circle and calculate area and circumference. Programming

C- Read Radius of Circle, Calculate Area and Circumference

  • April 20, 2021
  • 0 Comments

Write a c program to read radius of a circle and calculate area and circumference. The value of PI : 3.14159 C Code #include <stdio.h>#include <conio.h>#include <math.h>void main(){ float r, a, c; printf(“nEnter radius of a circle:”); scanf(“%f”,&r); a = M_PI*r*r; c = 2*M_PI*r; printf(“nArea of cicle = %f”,a); printf(“nCircumference of circle = %f”,c); getch();} […]

Display Multiplication Table of Entered Numbers Programming

C – Display Multiplication Table of Entered Numbers

  • April 20, 2021
  • 0 Comments

Write a c program to take input a number from user and display the multiplication table C Code #include <stdio.h>#include <conio.h>#include <math.h>void main(){ int number, i; printf(“Enter number : “); scanf(“%d”,&number); for(i = 1; i<=10; i++) printf(“n %d X %d = %d”, number, i, number*i); getch();} Output More experiment with multiplication table on c programming…  […]

Find Square Root of Entered Number Programming

C Program to Find Square Root of Entered Number

  • April 20, 2021
  • 0 Comments

Write a c program to take input from user and calculate square root of that entered number. C Code #include <stdio.h>#include <conio.h>#include <math.h>void main(){ float number; printf(“Enter number:”); scanf(“%f”,&number); printf(“square root of entered number %f is %f”,number, sqrt(number)); getch();} Output

find the largest number among three entered numbers Programming

C – Find the Largest Number Among Three Entered Numbers

  • April 20, 2021
  • 0 Comments

Write a program to take three integer number input from the user and find a greater number among them. C Code #include <stdio.h>#include <conio.h>#include <math.h>void main(){ int a, b, c; printf(“enter three numbers:”); scanf(“%d%d%d”,&a,&b,&c); if(a>=b && a>=c) printf(“%d is greater”,a); else if (b>=a && b>=c) printf(“%d is greater”,b); else printf(“%d is greater”,c); getch();} Output

Program to implement setw manipulator in OOP Programming

C++ Implement Setw Manipulator in OOP

  • April 19, 2021
  • 0 Comments

How to implement setw in c++ programming.  Implement setw manipulator in object-oriented programming. UNIVERSITY                    LOCATION                    TU                     KATHMANDUKU                     DULIKHEL C++ Code #include<iostream.h>#include<conio.h>#include<iomanip.h>void main(){ cout<<setw(10)<<“UNIVERSITY”<<setw(19)<<“LOCATION”<<endl; cout<<setw(10)<<“TU”<<setw(17)<<“BALKHU”<<endl; cout<<setw(10)<<“KU”<<setw(20)<<“DHULIKHEL”<<endl; cout<<endl<<“Thank you”<<endl; cout<<endl<<“Press any key to continue…”; getch();}

Program to find the sum of two numbers [int a,b,c]. Programming

C++ Find the Sum of Two Numbers [int a,b,c].

  • April 19, 2021
  • 0 Comments

Write a C++ Program to find the sum of two numbers; C++ Code #include<iostream.h>#include<conio.h>void main(){ int a,b,c; cout<<“Enter two numbers:”; cin>>a>>b; c=a+b; cout<<“The sum of two numbers is:”<<c; cout<<endl<<“Thank you”; cout<<endl<<“Press any key to continue…”; getch();}

Program to find Sum, Multiplication, Division, Subtraction by Using Function Programming

C++ Find Sum, Multiplication, Division, Subtraction by Using Function

  • April 19, 2021
  • 0 Comments

Write a program to find Sum, Multiplication, Division, Substraction by Using Function. C Code #include<iostream.h>#include<conio.h>void add(int a,char c, int b); void sub(int a,char c, int b); void mul(int a,char c, int b); void div(int a,char c, int b);void main(){ int a,b; char c; cout<<“Enter 1st number:”; cin>>a; cout<<“nEnter operater:”; cin>>c; cout<<“nEnter 2nd number:”; cin>>b; switch(c){ […]