#include <stdio.h>
#include <stdlib.h>
#include "info.h"
int main()
{
//sample//
printf("Hello!");
printf("This is my first code");
printf(" Im from %s","kodad");
int age;
int currentyear;
int birthyear;
birthyear = 2008;
currentyear = 2023;
age = currentyear - birthyear;
char text[7] = "years";
//There are only six characters but we have given seven because one for "string teminator"//
strcpy(text,"year");
printf(" My age is %d %s\n",age,text);
char *studentname[] = {"rk","manoj","maha","nish","pranav"};
printf("\nThe best student in our class is %s \n",studentname[0]);
printf("\nThe best student in our class is %s \n",studentname[1]);
printf("\nThe best student in our class is %s \n",studentname[2]);
printf("\nThe best student in our class is %s \n",studentname[3]);
printf("\nThe best student in our class is %s \n",studentname[4]);
//---------------------------------------------------------------//
printf("\nMy name is %s and im in %s\n", NAME,CLASS);
printf("\nMy name is %s and i got %d marks\n", NAME, MARKS);
int x2Marks = 2;
int Myresult;
Myresult = MARKS * x2Marks;
printf("\nMy name is %s and i got %d marks\n", NAME, Myresult);
//--------------------------------------------GETTING DATA FROM USER-------------------------------------------------------//
char person1[30];
char person2[30];
int mutualfriends;
printf("\ndont give space between first name and last name.\n");
printf("\nwhat is you name?(dont give space between first name and last name)\n");
scanf("%s" , person1);
printf("\nwho is your best friend?\n");
scanf("%s" , person2);
printf("\nhow many mutual friends do you have? (only numbers should be taken)\n");
scanf("%d" , &mutualfriends);
printf("My name is %s my best friend is %s and we have %d mutual friend" , person1 , person2 , mutualfriends);
//-----------------------------------------MATHEMATICAL OPERATIONS--------------------------------------------------------//
int a = 15;
int b = 3;
int c = a + b;
int d = a * b;
int e = a / b;
int f = a - b;
float m = 15;
float n = 6;
float k = m / n;
printf("\nThe result is %d" , c);
printf("\nThe result is %f" , k);
//-----------------------------------------avg=total marks/total subjects-----------------------------------------------=-//
float telugu, hindhi, english, social, mathematics, sceince, avg;
printf("\n\n\tTo find you average please enter following details");
printf("\n\n\tEnter your telugu marks:\n");
scanf("%f" , &telugu);
printf("\n\tEnter your hindhi marks:\n");
scanf("%f" , &hindhi);
printf("\n\tEnter your english marks:\n");
scanf("%f" , &english);
printf("\n\tEnter your social marks:\n");
scanf("%f" , &social);
printf("\n\tEnter your mathematics marks:\n");
scanf("%f" , &mathematics);
printf("\n\tEnter your sceince marks:\n");
scanf("%f" , &sceince);
avg = (telugu+hindhi+english+social+mathematics+sceince) / 6;
printf("The average is %.3f percent\n", avg);
//--------------------------------------page views for website------------------------------------------------------//
int pageview = 0;
pageview = pageview + 1;
printf("\n\n\n\n\n\nPage views: %d" , pageview);
pageview = pageview + 1;
printf("\nPage views: %d" , pageview);
pageview = pageview + 1;
printf("\nPage views: %d" , pageview);
pageview = pageview + 1;
printf("\nPage views: %d" , pageview);
pageview = pageview + 1;
printf("\nPage views: %d" , pageview);
//----------------------------------------COMPOUND INTREST---------------------------------------------------------------------//
float fDeposit = 100000;
float rateI = 1.07;
fDeposit = fDeposit*rateI;
printf("\n\n\nTotal Amount is %.3f/-" , fDeposit);
fDeposit = fDeposit*rateI;
printf("\n\n\nTotal Amount is %.3f/-" , fDeposit);
fDeposit = fDeposit*rateI;
printf("\n\n\nTotal Amount is %.3f/-" , fDeposit);
fDeposit = fDeposit*rateI;
printf("\n\n\nTotal Amount is %.3f/-" , fDeposit);
/* ------------------------------------------------daily uses----------------------------------------------*/
float dailyincome;
float apples;
float price;
float workingday;
printf("Enter how many apples were sold\n");
scanf("%f" , &apples);
printf("\nEnter price of each apple\n");
scanf("%f" , &price);
printf("\nEnter working days\n");
scanf("%f" , &workingday);
dailyincome = (price * apples) / workingday;
printf ("\n\n\n Your daily income is %f\n", dailyincome );
//-----------------------------------------------code execution-----------------------------------//
int yourclass;
printf("\n\nEnter you class in number:");
scanf("%d" , &yourclass);
if(yourclass >= 6){
float telugu, hindhi, english, social, mathematics, sceince, avg;
printf("\n\n\tTo find you average please enter following details");
printf("\n\n\tEnter your telugu marks:\n");
scanf("%f" , &telugu);
printf("\n\tEnter your hindhi marks:\n");
scanf("%f" , &hindhi);
printf("\n\tEnter your english marks:\n");
scanf("%f" , &english);
printf("\n\tEnter your social marks:\n");
scanf("%f" , &social);
printf("\n\tEnter your mathematics marks:\n");
scanf("%f" , &mathematics);
printf("\n\tEnter your sceince marks:\n");
scanf("%f" , &sceince);
avg = (telugu+hindhi+english+social+mathematics+sceince) / 6;
printf("The average is %.3f percent\n", avg);
}
if(yourclass<6){
printf("You are not eligible you have to be 6thclass or above to use this application.\n");
}
return 0;
}
0 Comments