#include<stdio.h>
#include<conio.h>
main()
{
int eng,math,phy,urdu,islamiat;
float percentage;
l1:
printf("Enter the marks obtained in English: ");
scanf("%d",&eng);
if(eng<0)
{
printf("\nInvalid input !obtained Marks cannot be negative\n\n");
goto l1;
}
l2:
printf("\nEnter the marks obtained in Mathematics: ");
scanf("%d",&math);
if(math<0)
{
printf("\nInvalid input !obtained Marks cannot be negative\n\n");
goto l2;
}
l3:
printf("\nEnter the marks obtained in Physics: ");
scanf("%d",&phy);
if(phy<0)
{
printf("\nInvalid input !obtained Marks cannot be negative\n\n");
goto l3;
}
l4:
printf("\nEnter the marks obtained in Urdu: ");
scanf("%d",&urdu);
if(urdu<0)
{
printf("\nInvalid input !obtained Marks cannot be negative\n\n");
goto l4;
}
l5:
printf("\nEnter the marks obtained in Islamiat: ");
scanf("%d",&islamiat);
if(islamiat<0)
{
printf("\nInvalid input !obtained Marks cannot be negative\n\n");
goto l5;
}
percentage= ((eng+math+phy+urdu+islamiat)*100/500);
printf("Percentage: %.2f",percentage);
printf("\n\n\n Grade:");
if(percentage>=80)
{
printf("A+");
}
else if(percentage>=70)
{
printf("A");
}
else if(percentage>=60)
{
printf("B");
}
else if(percentage>=50)
{
printf("C");
}
else
{
printf("F");
}
}
My Name Is Salman Masood , I am Computer Science &Amp; Maths Graduate from University of Karachi, Pakistan , Teaching Is My Passion and My Aim Is to Deliver All My Knowledge among Those Students Who Can'T Afford Tutors or Expensive Institute Fees. I Will Be Keep Sharing My All Knowledge and Information with You .... Remember Me in Your Prayers !
Tuesday, 12 December 2017
Learn C language Part -4 if else ,ladder if else, nested if else statements with practical example
#include <stdio.h>
#include <conio.h>
main()
{
int age;
printf("Enter your age: ");
scanf("%d",&age);
if(age>=18)
{
// printf("YOU ARE ELIGIBLE FOR THIS JOB......");
if(age<=20)
{
printf("YOU ARE ELIGIBLE FOR clerk JOB......");
}
else if(age<=25)
{
printf("YOU ARE ELIGIBLE FOR HR JOB......");
}
else if(age<=30)
{
printf("YOU ARE ELIGIBLE FOR manager JOB......");
}
else
{
printf("age limit exceeded!......");
}
}
else
{
printf("YOU ARE NOT ELIGIBLE FOR THIS JOB......");
}
}
#include <conio.h>
main()
{
int age;
printf("Enter your age: ");
scanf("%d",&age);
if(age>=18)
{
// printf("YOU ARE ELIGIBLE FOR THIS JOB......");
if(age<=20)
{
printf("YOU ARE ELIGIBLE FOR clerk JOB......");
}
else if(age<=25)
{
printf("YOU ARE ELIGIBLE FOR HR JOB......");
}
else if(age<=30)
{
printf("YOU ARE ELIGIBLE FOR manager JOB......");
}
else
{
printf("age limit exceeded!......");
}
}
else
{
printf("YOU ARE NOT ELIGIBLE FOR THIS JOB......");
}
}
Monday, 11 December 2017
Learn Sql server in hindi/urdu part-23(one to one relationship)
create table car
(
car_id int identity primary key,
car_name nvarchar(20) not null,
car_model nvarchar(10) not null,
)
insert into car
values('Mehran','1980')
select * from car
create table employee
(
emp_id int identity primary key,
emp_name nvarchar(20) not null,
emp_desig nvarchar(20) not null,
emp_car_fk int unique foreign key references car(car_id)
)
insert into employee
values('ahmed','officer',2)
select e.emp_id,e.emp_name,e.emp_desig,c.car_id,c.car_model,c.car_name from employee e inner join car c on c.car_id=emp_car_fk
Sunday, 10 December 2017
Learn C language Part 3 swapping the values of two variables
#include <stdio.h>
#include <conio.h>
main()
{
int x,y,z;
printf("Enter the value of x: ");
scanf("%d",&x); //5
printf("Enter the value of y: ");
scanf("%d",&y);//10
z=x; //z=5
x=y; //x=10
y=z; //y=5
printf("\n\n\n\nx=%d",x);
printf("\ny=%d",y);
}
Learn C language Part 3 swapping the values of two variables
#include <stdio.h>
#include <conio.h>
main()
{
int x,y,z;
printf("Enter the value of x: ");
scanf("%d",&x); //5
printf("Enter the value of y: ");
scanf("%d",&y);//10
z=x; //z=5
x=y; //x=10
y=z; //y=5
printf("\n\n\n\nx=%d",x);
printf("\ny=%d",y);
}
Learn C language Part 3 swapping the values of two variables
#include <stdio.h>
#include <conio.h>
main()
{
int x,y,z;
printf("Enter the value of x: ");
scanf("%d",&x); //5
printf("Enter the value of y: ");
scanf("%d",&y);//10
z=x; //z=5
x=y; //x=10
y=z; //y=5
printf("\n\n\n\nx=%d",x);
printf("\ny=%d",y);
}
Learn C language Part 2 scanf command, sum of two integer numbers
#include<stdio.h>
#include<conio.h>
main()
{
int x,y;
int z;
printf("Enter the value of x :");
scanf("%d",&x);
printf("Enter the value of y :");
scanf("%d",&y);
z=x+y;
printf("value of z = %d",z);
}
Subscribe to:
Posts (Atom)
Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC
Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...
-
Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...
-
Load event: pictureBox3.Image = Image .FromFile( @"C:\Users\salman\Documents\Visual Studio 2013\Projects\WindowsFormsApplication3\W...