## Search This Blog

Showing posts with label ask the user for empid salary and age and display. Show all posts
Showing posts with label ask the user for empid salary and age and display. Show all posts

April 10, 2019

## C Program to calculate sum of 5 subjects & find percentage

Hey Guys,Welcome back.
In this tutorial i am giving tutorial on How to calculate Sum of 5 Subjects and how to find Percentage of all 5 subjects using C program.

CODE

#include<stdio.h>
int main()
{
int a,b,c,d,e,sum,per;                          //a,b,c,d,e are 5 subjects
printf("\n ENTER MARKS OF 5 SUBJECT");
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
scanf("%d",&e);

sum=a+b+c+d+e;
per=sum/500*100;

printf("\n SUM = %d",sum);
printf("\n PERCENTAGE = %d",per);
}

OUTPUT

April 10, 2019

## Program to Ask The User for Empid, Age, Salary and Display

Hey Coders, Welcome Back.
So this tutorial will help You to Create a program to Take input From users.
And Then Print it Same on the screen.

C program to ask the user details like empid,age,salary and display the same.Program to take input from users and display it.

CODE

#include<stdio.h>

int main()
{
int id,age,salary;

printf("\n ENTER EMPID");
scanf("%d",&id);

printf("\n ENTER AGE");
scanf("%d",&age);

printf("\n ENTER SALARY");
scanf("%d",&salary);

printf("%d",id);
printf("%d",age);
printf("%d",salary);
return 0;
}

OUTPUT

Hope you guys learn something watch other blogs too.