WAP to input a number and its power then show number to the power.

Note: Use pow(n,p) function

#include<stdio.h>

#include<conio.h>

#include<math.h>

int main()

{

double n,p;

double result;

printf(“Enter the numberĀ  : “);scanf(“%lf”,&n);

printf(“Enter the power : “);scanf(“%lf”,&p);

result=pow(n,p);

printf(“%.2lf to the power %.2lf is %.2lf”,n,p,result);

getch();

}

Advertisements

Its all about ‘C’ language

WAP to input rollno, name and gender of a student and show it.

#include<stdio.h>

#include<conio.h>

int main()

{

int rollno;

char gender;

char name[21];

printf(“Enter rollno : “); scanf(“%d”,&rollno);

printf(“Enter Name : “);fflush(stdin);scanf(“%[^\n]”,&name);

printf(“Enter Gender [M/F] ? “);fflush(stdin);scanf(“%c”,&gender);

printf(“roll no is %d, Name is %s and Gender is %c”,rollno,name,gender);

getch();

}